fix(codegen): require dense storage for static numeric array proofs - #9803
fix(codegen): require dense storage for static numeric array proofs#9803proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe compiler now limits static numeric-array promotion to lengths supported by fresh dense storage. Regression coverage adds module-level arrays at and above the 1,000,000-element limit, timeout handling, expected output checks, and a changelog entry. ChangesPresized array growth
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Large statically sized numeric arrays now retain guarded growth when their logical length exceeds fresh dense capacity, preventing the reported module-scope slowdown and invalid unchecked stores. Threshold and runtime regression coverage support merge readiness. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Landed on |
Closes #9784.
A static
new Array(1000001)could receive an unchecked numeric-array store even though the runtime allocates only a small initial backing store above one million elements. The compiler'sPtr<NumArray>proof accepted lengths up to 16 million and confused logical length with allocated capacity. Module constants expose that proof; the original function-parameter example does not.Restrict the proof to the runtime's fresh dense allocation limit. Larger arrays keep the existing guarded paths, which grow their backing storage as needed. No runtime allocation policy or version change.
The regression adds module-scope fills at 1,000,000, 1,000,001, and 1,200,000 elements, plus a function with a literal length. It extends
issue_9371_large_presized_array.rsand retains its moving-GC runs, expando, object-element, and genuinely sparse controls. The test has a bounded execution timeout so a regression cannot hang CI. Collector coverage checks literal and module-constant provenance at the boundary.Evidence and validation:
PERRY_PTR_NUMARRAY_LOCALSmade the module fixture complete in 0.51 seconds.12efed1222: runtime 3,137 passed / 4 ignored; CLI 1,083 passed and the existingPERRY_CONCAT_SITE_CACHEaudit failure addressed by fix(cache): register concat switch and explain codegen inputs #9748. The codegen suite was run separately because the runner stops at that CLI failure.Summary by CodeRabbit