Skip to content

t27b: frames over 16 KiB of local aggregates, with stack probing (lane 5) #7367

Closed as not planned

Description

@gHashTag

Part of #6063 (t27b coverage, lane 5).

t27b refuses every fn or test whose local aggregates take more than 16384 bytes of stack, as FnDecl(frame size). The cap exists because the prologue lowers sp in one step, and a single step larger than the guard page could jump over it without faulting.

specs/port/scripts/gen_w384_lean.t27 is the corpus spec that hits it: its test main_appends_the_exact_w384_text declares var buf: [16384]u8, plus 64 bytes of other locals, for 16448 bytes in one frame. The reference (t27c gen + zig test) passes it, 12 tests, 0 vacuous.

Plan:

  • New conformance spec specs/tri/t27b/conformance/large_frame.t27, written first and passing t27c test-report (4 of 4, 9 runtime asserts). It covers a test body with a 20000-byte array, a fn with 48000 bytes called twice, 16384 + 64 bytes (the w384 shape), and recursion 12 frames deep at 20000 bytes each.
  • Codegen (cli/t27b/src/codegen.rs): a frame larger than 16 KiB is allocated in 4096-byte steps, and each step stores to the new sp before the next one (stack probing, the same idea as GCC's -fstack-clash-protection on AArch64). The remainder is probed too. Frames up to 16 KiB keep their current one-step prologue. The cap rises from 16 KiB to 1 MiB, and frames above 1 MiB are still refused as FnDecl(frame size).
  • The spec is not edited to squeeze under the old cap.
  • Ledger: gen_w384_lean moves from codegen to pass, and the new spec gets a pass row, if the lab corpus run agrees.

Boundary

  • specs/port/scripts/gen_w384_lean.t27
  • specs/tri/t27b/conformance/large_frame.t27
  • cli/t27b/src/codegen.rs

User Scenarios

  • Given a test declares a local array of 20000 bytes, When the test is compiled with t27b, Then the function prologue allocates the frame in 4096-byte steps with a store to the new sp at each step before continuing.
  • Given a function declares 48000 bytes of local aggregates and is called twice from a test, When the test runs under t27b, Then both calls execute without stack fault and the frame size cap permits up to 1 MiB.
  • Given the existing corpus spec specs/port/scripts/gen_w384_lean.t27 with its test main_appends_the_exact_w384_text using 16448 bytes of locals, When the suite is run with t27b, Then all 12 tests pass and the spec moves from codegen to pass in the ledger.

Requirements

  • FR-001: The codegen in cli/t27b/src/codegen.rs MUST emit a prologue that lowers sp in increments of 4096 bytes for any frame larger than 16384 bytes, storing to the new sp at each increment before the next decrement.
  • FR-002: The remainder after the last full 4096-byte step MUST also be probed with a store to the final sp.
  • FR-003: Frames of 16384 bytes or less MUST keep the existing single-step prologue with no probing stores.
  • FR-004: The frame size limit MUST be raised from 16 KiB to 1 MiB (1048576 bytes); frames exceeding 1 MiB MUST still be rejected with FnDecl(frame size).
  • FR-005: The new conformance spec specs/tri/t27b/conformance/large_frame.t27 MUST cover four cases: a 20000-byte array in a test, a 48000-byte frame function called twice, a 16448-byte frame matching the w384 shape, and a 12-frame recursion at 20000 bytes each.

Success Criteria

  • t27c test-report specs/tri/t27b/conformance/large_frame.t27 exits 0 with 4 of 4 tests passing and 9 runtime asserts.
  • t27c test-report specs/port/scripts/gen_w384_lean.t27 exits 0 with 12 tests passing, 0 vacuous.
  • The ledger shows specs/port/scripts/gen_w384_lean.t27 moved from codegen to pass, and specs/tri/t27b/conformance/large_frame.t27 listed as pass.

Activity

  1. added
    needs-boundaryNo '## Boundary' section, so the Queen can reserve nothing for it and no bee can take it
    on Oct 7, 2026
  2. gHashTag commented on Oct 7, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened 2026-10-07: the bulk close of issues without a ## Boundary section was reverted by the owner. Nothing to do here; this comment replaces the earlier close notice.

  3. added
    needs-shapeIssue lacks Boundary/Scenarios/Requirements/Success criteria
    on Oct 7, 2026
  4. removed
    needs-boundaryNo '## Boundary' section, so the Queen can reserve nothing for it and no bee can take it
    on Oct 7, 2026
  5. added a commit that references this issue on Oct 7, 2026
    4ea8b26
  6. removed
    needs-shapeIssue lacks Boundary/Scenarios/Requirements/Success criteria
    on Oct 7, 2026
  7. github-actions commented on Oct 17, 2026

    @github-actions
    Contributor

    Re-filed as #9880.

    An attempt claimed this issue on 2026-10-07 and left an empty branch. A dispatch row that has spent its retry ceiling is released once and then keeps its issue for good, which is the right rule for a third identical failure and the wrong outcome for an issue nobody ever attempted twice. The new issue carries the same work, the same boundary, and today's brief.

    Closing this one so the swarm can take the work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions