Skip to content

perf(compiler): retain numeric loops and virtual arguments - #99

Merged
dirkdev98 merged 4 commits into
mainfrom
perf/benchmark-loop-state-20261108
Nov 8, 2026
Merged

dirkdev98 merged 4 commits into
mainfrom
perf/benchmark-loop-state-20261108

Conversation

@dirkdev98

@dirkdev98 dirkdev98 commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Numeric loops repeatedly box integer Math results and rediscover Array storage. Dynamic arguments reads also create property tables under mutable primordials. Retain guarded loop state and read eligible unmapped arguments directly from a rooted incoming slice.

  • Array stores overwrite present writable own elements, preserve the deletion barrier, and publish completed iterations before polling. All restarting checks precede the sole store.
  • Prepared Number keys remain private inside the guarded region, preserving the single-conversion contract. DataView windows keep their byte-scaled proof.
  • Incoming reads retain extra arguments and stay bound to their activation. Mapped slots, materialized objects, coercing keys and out-of-range indices retain ordinary object behavior.

Local ARM64 closed-world production measurements on AC power, seven interleaved pairs with matching checksums:

                                      before       after
serial-compute, 192 million updates    921.0 ms     191.7 ms   79.0% paired reduction
am3 kernel, 40 digits x 100000 rounds  1826   ms    1126   ms   38.2% paired reduction

V8 v7, three interleaved pairs after warmup per comparison. Higher scores are better; every internal check and all eight sub-scores pass. Each sample has ready/AC environment probes before and after it.

                 dense before/after      incoming reads before/after
Total              6064 -> 6345             6316 -> 6483  
Richards           5447 -> 5546             5549 -> 5539  
DeltaBlue          4589 -> 4516             4597 -> 4516  
Crypto            10258 -> 14087           14033 -> 14000 
RayTrace           8688 -> 8780             8736 -> 8697  
EarleyBoyer        7647 -> 7740             7613 -> 9283  
RegExp              786 -> 796               785 -> 801   
Splay              9591 -> 9566             9476 -> 9450  
NavierStokes      14204 -> 14218           14366 -> 14133 

Dense Array comparison: 824d76843 to 630e49060, total +4.6%, Crypto +37.3%, NavierStokes +0.1%. Incoming comparison: 630e49060 to c09015518, total +2.6%, EarleyBoyer +21.9% with paired gains 22.16%, 21.62%, 21.47%; NavierStokes -1.6%. Other non-target changes in that run range from -1.8% to +2.0%.

These are narrow measured wins. Broader JavaScript v1/v2 wall time remains inconclusive; Node-normalized v1 ratios flagged regressions as the reference varied. No broad portfolio improvement claim.

Focused local correctness, native backend parity, GC stress, UBSan, selected key-conversion Test262 checks, type-check and lint pass. The incoming slice adds 299 focused unit checks and three UBSan native cases; the full eval-based arguments selection reached its 300-second cap without completed fixtures. Current-head canonical CI is pending; all canonical lanes passed on 630e49060.

Retained local evidence: .cache/bench-codex-20261108/, including source identities, raw samples and the source for the existing Project Visualize artifact.

- Admit certified imul and clz32 calls to existing safe-integer regions, retaining entry guards and iteration fallback.

- Cover mutable and locked builtins, zero-trip identity, numeric boundaries, coercion, abrupt completion and GC polling.

- Serial compute: 921.0 to 191.7 ms over seven matched pairs; broader JavaScript absolute timings remain inconclusive.

- Validate 60 focused unit tests, 34 native checks, type-check and lint.
- Admit present writable Array elements and private prepared Number keys in fixed storage loops.
- Check independent indices before committing a sole store and preserve deletion barriers and completed-iteration polling.
- Cover fallback semantics, aliases, descriptors and GC stress; retain key-once Test262 regressions.
- Validate 64 focused unit checks, both UBSan fixture variants, three Test262 paths, type-check and lint. am3 improves 1862 to 1141 ms over seven pairs, indicative; the V8 comparison remains inconclusive after concurrent host work.
@dirkdev98 dirkdev98 changed the title perf(compiler): retain integer Math recurrences in loop regions perf(compiler): retain numeric state and dense array loop storage Nov 8, 2026
- Keep scaled DataView byte-window proofs when selecting checked terminal stores.
- Verify per-access bounds for newly admitted non-affine stores and stale induction inputs; retain rejection of observable effects.
- Validate 148 focused planner checks, eight native DataView checks, type-check and lint.
- Retain and root complete incoming slices for guarded unmapped element reads.
- Keep object fallback, mapped parameters and activation-sensitive transforms safe.
- Cover codec retention, nested calls, inherited indices and heap identity under UBSan.
@dirkdev98 dirkdev98 changed the title perf(compiler): retain numeric state and dense array loop storage perf(compiler): retain numeric loops and virtual arguments Nov 8, 2026
@dirkdev98
dirkdev98 merged commit 3426a8c into main Nov 8, 2026
12 checks passed
@dirkdev98
dirkdev98 deleted the perf/benchmark-loop-state-20261108 branch November 8, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant