ReviewOS

zig-utils/zig-js

VM: remove legacy numeric recurrence body recognizers

#1074
Closed chris opened this 8 days ago ·
8 days ago

Parent: #498 Related: #491, #465

The live quickening inventory labels pure and observable numeric recurrence paths as legacy_narrow / legacy_pattern_kernel. The pure path recognizes one exact bytecode body and computes a 256-element recurrence result/step table instead of executing the recursive calls; the observable variant recognizes one exact counter-updating body. Both conflict with the roadmap rule excluding body recognizers and computed-result caches.

Executed baseline: a no-native-owner fib(8) witness with VM inline calls disabled returns 21 and records 774 logical steps. Existing recurrence tests pass 4/4 and explicitly assert legacy-kernel hits. The VM-entry metric counts outer driver entry, so its value of 1 is not evidence of activation count; actual recursive statement events will be the call-observability witness.

Acceptance:

  • Remove both recognizers/executors, their result/step tables, cached recurrence Chunk metadata, and test-only hit counters.
  • Execute recursion through the general VM activation/call paths, preserving result 21, logical steps 774, rebinding, argument semantics, observable calls, and exceptions.
  • Preserve and strengthen restriction/checkpoint, debugger/profiler, GC, no-GIL, termination, budget, and OOM witnesses using ordinary execution.
  • Relevant exact before/after corpus and tree/VM comparisons introduce no new failures; focused normal, ReleaseSafe, and unsuppressed TSan gates pass.
  • Remove live inventory coverage for the deleted kernels and regenerate docs/manifest; keep historical benchmark artifacts intact and identify the remaining legacy families honestly.

This removes benchmark-shaped work substitution. General no-JIT performance improvements remain open under #498; do not claim the removal establishes throughput parity.

8 days ago

Attribution correction: vm_entries counts outer driver entry, not each trampoline activation, so the observed value 1 must not be compared to 68 activations. The issue body is corrected. The executed legacy-kernel hit tests establish use of the recognizers; recursive statement-profiler events will verify ordinary call observability after removal. The result 21 and logical-step golden 774 remain valid measurements.

8 days ago

Landed in 7cbe01e. Both exact recurrence recognizers, the computed result/step table, cached Chunk plan, special executors, and hit counters are deleted. Recursion uses general VM calls and activations. Historical reports remain intact; the live inventory removes those two families and still identifies seven remaining legacy families.

Validation:

  • recursive execution focused gate: 8/8 normal, unsuppressed TSan, and ReleaseSafe;
  • result 21 and logical steps 774 retained; ordinary activation storage is exercised; profiler observes all 67 returns;
  • expanded profiler/debugger/GC gate: 2/2 in all three modes; tree debugger observes all 67 returns and the existing required-bytecode debugger rejection remains explicit;
  • restrictions after checkpoints, rebinding, observable counters/accessors, no-GIL workers, budget, termination, and GC reentry pass;
  • activation OOM sweep extended with recursive execution: 2/2;
  • exact before/after corpus remains 1,316 pass / 0 fail; paired output remains 1,313 agreements plus the same three pre-existing tree-fail/VM-pass TCO divergences, with byte-identical output for every group;
  • inventory writer/self-test/validator, 378-file documentation links, and manifest-checked 51-page docs build pass.

Flips 0 test262 cases; no new measured failures or divergences. No throughput claim. Full hosted CI is pending. General debugger bytecode admission and the other legacy kernels remain broader roadmap work.

Sign in to comment on this issue.