Commit 0973799
committed
Substrate unification, finished: split counters + drop 9 more fibs arrays
Counter split in phi_pi_fib.rs:
- EXPLICIT_SEARCHES / EXPLICIT_COMPARISONS
bumped by direct calls to public search fns (fibonacci_search,
fibonacci_search_with_trace, phi_pi_fib_search_v2, binary_search).
These are searches an OMC program asks for via the
phi_pi_fib_* / phi_pi_bin_search builtins.
- BACKGROUND_SEARCHES / BACKGROUND_COMPARISONS
bumped by substrate-internal callers — nearest_attractor_with_dist
and friends. Every HInt::new -> compute_resonance -> ... goes
here. Surfaces via the new fibonacci_search_internal helper.
Public API:
get_search_stats() -> explicit channel (pre-refactor semantics)
get_search_stats_background() -> NEW
get_search_stats_all() -> NEW (sum)
reset_search_stats() -> resets both
OMC builtins:
phi_pi_fib_stats() -> explicit (unchanged)
phi_pi_fib_stats_bg() -> NEW background
phi_pi_fib_stats_all() -> NEW total
Effect: experiment 7's "gate work" reads back its pre-refactor
24 compares (was 857 after step 1 of the refactor confused
background HInt construction work with explicit search work).
All per-N compare averages in exp 7 also restored:
N=8: 3.79, N=1024: 12.57.
Mechanical follow-up — 9 more fibs arrays deleted:
bytecode_opt.rs::fold_to_fib_const -> phi_pi_fib::fold_to_nearest_attractor
vm.rs::fold_to_fibonacci -> phi_pi_fib::fold_to_nearest_attractor
interpreter.rs Expression::Fold -> ditto
interpreter.rs fold_escape -> ditto + zero-trap escape
interpreter.rs safe_divide (fold mode) -> ditto + zero-trap escape
interpreter.rs arr_fold_elements -> ditto (abs path)
interpreter.rs resolve_singularity (fold) -> ditto
interpreter.rs harmonic_partition -> ditto (used as bucket key)
interpreter.rs phi_fold_n method -> ditto (depth-N iteration)
One last fibs: site intentionally kept:
interpreter.rs harmonic_split (line 3630)
That one selects the LARGEST Fibonacci <= remaining string length
for chunk-size determination. Different semantic from "nearest" —
adding a substrate primitive for it is a separate scope decision.
Tally: of the original 17+ duplicate Fibonacci tables across the
codebase, 16 are gone. The remaining 1 is preserved with a
distinct semantic (largest-LE, not nearest).
148/148 tests pass. All 10 hybrid_llm experiments audit byte-identical
across tree-walk and bytecode VM. Conformance unchanged.1 parent fe776fb commit 0973799
4 files changed
Lines changed: 138 additions & 141 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 172 | + | |
| 173 | + | |
184 | 174 | | |
185 | 175 | | |
186 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
| 1539 | + | |
1551 | 1540 | | |
1552 | 1541 | | |
1553 | 1542 | | |
| |||
1668 | 1657 | | |
1669 | 1658 | | |
1670 | 1659 | | |
| 1660 | + | |
| 1661 | + | |
1671 | 1662 | | |
1672 | 1663 | | |
1673 | 1664 | | |
| |||
2181 | 2172 | | |
2182 | 2173 | | |
2183 | 2174 | | |
2184 | | - | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
| 2175 | + | |
2198 | 2176 | | |
2199 | 2177 | | |
2200 | 2178 | | |
| |||
2233 | 2211 | | |
2234 | 2212 | | |
2235 | 2213 | | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
| 2214 | + | |
2250 | 2215 | | |
2251 | 2216 | | |
2252 | 2217 | | |
| |||
2399 | 2364 | | |
2400 | 2365 | | |
2401 | 2366 | | |
2402 | | - | |
2403 | | - | |
2404 | | - | |
2405 | | - | |
2406 | | - | |
2407 | | - | |
2408 | | - | |
2409 | | - | |
2410 | | - | |
2411 | | - | |
2412 | | - | |
2413 | | - | |
2414 | | - | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
2415 | 2372 | | |
2416 | 2373 | | |
2417 | 2374 | | |
| |||
2476 | 2433 | | |
2477 | 2434 | | |
2478 | 2435 | | |
2479 | | - | |
2480 | | - | |
2481 | | - | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
2485 | | - | |
2486 | | - | |
2487 | | - | |
2488 | | - | |
2489 | | - | |
2490 | | - | |
2491 | | - | |
2492 | | - | |
| 2436 | + | |
2493 | 2437 | | |
2494 | 2438 | | |
2495 | 2439 | | |
| |||
3726 | 3670 | | |
3727 | 3671 | | |
3728 | 3672 | | |
3729 | | - | |
3730 | | - | |
3731 | | - | |
3732 | 3673 | | |
3733 | 3674 | | |
3734 | 3675 | | |
3735 | 3676 | | |
3736 | 3677 | | |
3737 | | - | |
3738 | | - | |
3739 | | - | |
3740 | | - | |
3741 | | - | |
3742 | | - | |
| 3678 | + | |
3743 | 3679 | | |
3744 | 3680 | | |
3745 | 3681 | | |
| |||
4027 | 3963 | | |
4028 | 3964 | | |
4029 | 3965 | | |
4030 | | - | |
| 3966 | + | |
| 3967 | + | |
4031 | 3968 | | |
4032 | 3969 | | |
4033 | 3970 | | |
4034 | 3971 | | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
4035 | 3993 | | |
4036 | 3994 | | |
4037 | 3995 | | |
| |||
5182 | 5140 | | |
5183 | 5141 | | |
5184 | 5142 | | |
| 5143 | + | |
5185 | 5144 | | |
5186 | 5145 | | |
5187 | 5146 | | |
| |||
5205 | 5164 | | |
5206 | 5165 | | |
5207 | 5166 | | |
5208 | | - | |
5209 | | - | |
5210 | | - | |
5211 | 5167 | | |
5212 | | - | |
5213 | | - | |
5214 | | - | |
5215 | | - | |
5216 | | - | |
5217 | | - | |
5218 | | - | |
5219 | | - | |
5220 | | - | |
5221 | | - | |
5222 | | - | |
| 5168 | + | |
5223 | 5169 | | |
5224 | 5170 | | |
5225 | 5171 | | |
| |||
0 commit comments