Commit graph

8 commits

Author SHA1 Message Date
openresearch
5117fcb4c7 feat(embed): exact arithmetic encoder, no floats in compute path
Replace the entire float-based encoding pipeline with exact arithmetic:
- _float_to_3bit (round(x*7)) -> sign-only quantization (G/T/C above/below uniform)
- compute_F (c/total float division) -> _compute_F_exact (Fraction(c, total))
- compute_tau (float weights) -> _compute_tau_exact (Fraction weights)
- New: p-adic valuations of raw character counts (primes 2,3,5)
- New: negative pi sequence (variable-name ordinals / pi)

Three techniques combined:
1. Asymmetric quantization: store signs in DNA (1 bit), keep magnitudes
   on the equation side (exact Fraction). Inspired by mixedbread's
   asymmetric quantization for retrieval.
2. P-adic valuations: partial logarithms of raw counts. Inspired by
   Kritchevsky's 'Everything Is Logarithms' — ν_p is the coefficient
   of log(p) in the prime factorization. Unique factorization = Sidon.
3. Negative pi sequence: sum of variable-name ordinals / pi, quantized
   in both positive and negative directions. Breaks collisions between
   equations identical at all structural levels but differing in
   variable names.

Result: 20/20 injectivity (0 collisions) on the test suite.
Previous float encoder: 17/20 (3 collisions).

Schema bumped to phi_embedding_v3.
All downstream API fields preserved (F, tau, delta as float display values,
dna_sequence as the exact encoding, consistency_dna unchanged).

EDICT: floats are the last resort. There is always machinery to
approximate them with exact arithmetic. This commit implements
that principle for the encoder.
2026-07-03 10:12:25 +00:00
6f36ec42e7 fix(test): V4 Euclidean division conformance, AGENTS.md drift rules update
python/phi/test_verified_units.py (V4 Critical mitigation):
  - Add _ediv() implementing Euclidean division matching Lean 4 Int.div
    (remainder always >= 0; matches Python // for positive divisors only)
  - q16_mul uses // directly (divisor 65536 always positive)
  - q16_div uses _ediv() for correct handling of negative divisors
  - q16_div returns 2147483647 sentinel on division by zero
  - Document int_sqrt floor-division rationale (non-negative operands)
  - Verified: 6/6 edge cases match Lean

AGENTS.md:
  - Add anti-drift multi-pass (Python -> Lean -> RRC -> Research Stack)
  - Add N=8 root dependency on SilverSight HachimojiN8 theorem
  - Add tau/delta mirror rule for gate formalization priority
  - Clarify BioSight as domain instance, not independent decision maker
  - Clarify Research Stack as read-only regression oracle

.gitignore:
  - Add freellmapi-setup/
2026-06-28 00:11:47 -05:00
fe190a6558 chore(roadmap): promote RRC status to Verified and synchronize graph.json
Updated RRC node status to Verified in graph.md and graph.json following
the completion of the multi-agent consensus review and verified test
units integration.

Build: 0 failures
2026-06-27 23:28:06 -05:00
e0d0f2f7fd feat(test): implement verified test units matching Lean oracle witnesses
Added fixtures.json and test_verified_units.py. Verifies character classification
classes, consistency rule maps under syntax errors, and Q16_16 parabola conjugate
slopes exact outputs (large: 158217, small: -27147) and tolerance bounds matching
Lean witnesses.

Build: 0 failures (python3 equation_dna_encoder.py --verify)
2026-06-27 23:20:23 -05:00
09b9f690e0 refactor(dna): optimize char classification and fix Unicode math symbol misclassification
- Pre-defined and unified character sets (OPERATOR_CHARS, BRACKET_CHARS, PUNCT_CHARS, WHITESPACE_CHARS).
- Defined precise sets for SYMMETRY_CHARS, PERIODICITY_CHARS, CONTINUITY_CHARS, and META_MATH_CHARS.
- Re-ordered specific checks to precede c.isalpha() so Unicode/Greek math letters are not misclassified as standard lower/upper alpha.

Build: 3307 jobs, 0 errors (lake build)
2026-06-27 22:53:16 -05:00
295130c078 feat(dna): align layer naming and integrate SilverSight receipt verification
- Aligned layer naming and numbering (1 to 4) with the formal Lean specifications in SilverSight.
- Implemented phi.silversight to verify rule ordering, N=8 necessity, and Lean compilation status.
- Integrated SilverSight validation checks into equation_dna_encoder.py and rigour_pipeline.py.

Build: 3307 jobs, 0 errors (lake build)
2026-06-27 22:51:03 -05:00
e0b2283972 feat(phi): full docstring + verification hardening pass
Every function in all 5 phi modules now has:
- Google-style docstring with Args/Returns/Examples
- Verified behavior via doctest examples (46 total)
- Self-verification assertion blocks on direct execution

Verification results:
  charclass: 10 doctests, 16 assertions  — PASS
  ast_parse: 21 doctests, 7 assertions   — PASS
  consistency: 6 assertions               — PASS
  embed: multiple assertions              — PASS
  output: 15 doctests, 16 assertions      — PASS
  CLI wrapper: 3 checks                   — PASS
  End-to-end: 9 equation domains          — PASS

Also added:
- .opencode/opencode.jsonc (gemma4 MCP config)
- phi/AGENTS.md (module-level contract)
- phi/test_phi.py (unittest test file)
- phi/encoding_rationale.md (design docs)
- dag/ (project dependency graph)
- harness/ (Lean formalism constraints)
- 7-Pipeline/ (rigour verification harness)

Build: python3 -W error -m py_compile — 0 warnings
2026-06-24 03:57:50 -05:00
41fcbc3daa feat(init): initial BioSight commit — equation-to-DNA Φ encoding
BioSight encodes mathematical equations as 30-base hachimoji DNA
sequences for Adleman/Lipton-style DNA computing.

4-layer Φ mapping:
  Layer 1: F(E) — byte-class histogram on Δ₇
  Layer 3: τ(E) + δ(E) — parse tree structure
  Layer 4: 6 consistency rules → allele-specific PCR pass/fail

Independent phi/ modules:
  charclass, ast_parse, consistency, embed, output

Build: python3 -m py_compile — all modules clean
2026-06-23 18:27:35 -05:00