Repository navigation
feat(t27b): parameters past the 8th of a class go on the stack - #6313
Merged
Merged
Conversation
FnDecl was the top of the t27b greedy blocker order (+15 files), and all 15 were fns with more than 8 parameters. Past x0-x7 / d0-d7 the rest go on the stack, one full word each in parameter order; the callee reads them at [x29 + 16 + 8*s]. This is t27b's own convention, so such a fn joins internal_abi and is not exported from an object file. The remaining FnDecl refusals are named: untyped param, comptime param, duplicate, too many params (cap 64). t27b corpus specs: pass 296 -> 311, rejected 633 -> 618, mismatch 0. Closes #6312 Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6312
Refs #6063
What
FnDeclwas at the top of thet27b corpus specs --blockersgreedy order at master 1318adf, with +15 files. All 15 had the same shape: a fn with more than 8 parameters.Parameters past the 8th of a class (x0-x7, d0-d7) now go on the stack:
Program::stack_args).spby round16(8n), stores the words, callsbl, then restoressp. Spilled temps are biased by that amount.[x29 + 16 + 8*s]and re-normalises narrow ints.Apple arm64 packs narrow stack arguments, so this convention is t27b's own and not the platform's. Such a fn therefore joins
internal_abi, and object files do not export it.The remaining
FnDeclrefusals now name their shape:FnDecl(untyped param): 7 files. Greedy step 51, +4. These arestruct {}parameter types, orcomptime T: typeparams that the front-end hands over with no type.FnDecl(comptime param)FnDecl(duplicate)FnDecl(too many params), capped at 64.t27b corpus specs (1257 files)
Each of the 15 newly passing files also passes
t27c test-reportfrom the same master, with the same test count:Top first-rejection blockers after this change:
The next greedy steps are:
Tests
New tests in
cli/t27b/tests/source.rs:stack_parameters_reach_the_callee_in_ordercovers a 13-param mix of narrow and negative values, an sret pointer as the 9th word, recursion with 10 params, and temps that stay live across the call. It includes one test that fails on purpose.f64_and_integer_stack_parameters_interleavecovers 19 mixed params in a leaf function, and 10 f64 params in a non-leaf function.fn_declaration_rejections_are_precisechecks the named refusals.t27c agrees on both programs: 5 pass and 1 fail, and 2 of 2. Two mutation controls each make these tests fail: a wrong stack slot, and a missing sp bias on a spilled temp.
cargo test -p t27bis green.Notes
docs/reports/t27b_expectations.jsonis not re-blessed here. The lab ratchet will report these 15 files as UNEXPECTED PASS until it is re-blessed.🤖 Generated with Claude Code