Skip to content

Use shape-proven F64 facts in guarded loop regions - #11708

Closed
proggeramlug wants to merge 6 commits into
PerryTS:mainfrom
proggeramlug:codex-step5-p7-20260930
Closed

proggeramlug wants to merge 6 commits into
PerryTS:mainfrom
proggeramlug:codex-step5-p7-20260930

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Numeric object fields proven by a ShapeId now remain native doubles throughout a guarded loop region. Before this change, reads entered the region fast clone but boxed into generic arithmetic for receiver shapes learned at runtime; the same four-read matrix cells cost 44 or 92–94 instructions per iteration. Afterward they cost 19 or 49–50, with Node-equivalent output and unchanged overwrite controls.

Changes

  • Carry exact F64 field-representation facts from static births or the region supplier into the region prime ABI and scoped numeric analysis.
  • Enter the fast clone only when the receiver shape and requested representation agree; fall back to the generic clone on misses or deprecated/spilled fields.
  • Count actual fast iterations with an R fact, and test the emitted native loads/adds and stale-read fallback.
  • Add a changelog entry.

Related issue

n/a — step 5 P7 of the one-shape object-model campaign.

Test plan

  • Release compiler/runtime/stdlib build from exact code head 3699de102886963c8267d5b572d654232caea26a; final PR head d7f5e014d9618f05e49b79e2f8d4d9ce82adaa99 adds only the changelog.
  • Full serial codegen suite: 1,840 passed, 0 failed, 1 ignored; focused region tests and runtime prime refusals passed.
  • Pinned Node 26.5.1 parity for tsc 5.8.2, Zod, and numeric matrix fixtures.
  • Three numeric matrix fixtures each execute 200,000 fast iterations with rloop_f_rep=200000; emitted fast IR has native load double and fadd double.
  • Same-link-mode nine-cell matrix against merged P4 artifacts: six improved, zero regressed, no output divergence; representative read4 44→19 and read4_stmt 92–94→49–50 instructions/iteration; overwrite 11→11.
  • Paired 5× tsc/Zod user-instruction medians: +0.002% / +0.021% versus merged P4, within sample noise.
  • Full serial runtime suite and final ABI/GC source gates are running.

Checklist

  • Workspace version and maintainer release metadata unchanged.
  • Changelog entry added.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Superseded by #11680 (merged as 073b079), which carries the P7 shape-proven F64 region work.

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