mirror of
https://github.com/allaunthefox/BioSight.git
synced 2026-07-31 03:05:22 +00:00
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. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| AGENTS.md | ||
| ast_parse.py | ||
| charclass.py | ||
| consistency.py | ||
| embed.py | ||
| encoding_rationale.md | ||
| fixtures.json | ||
| output.py | ||
| silversight.py | ||
| test_phi.py | ||
| test_verified_units.py | ||