Skip to content

2.3 Render authors five toolchain-requirement keys that README §1 gives to 2.2 Plan alone; #1996 deletes the only comment that marked it 'not yet' #1997

Description

@jlaustill

What

docs/architecture/README.md §1, Ownership table, at main 0cd96994b (lines 45-46):

| 2.2 | Plan | what C should exist? -- declarations and order, includes, helpers, MISRA annotations, toolchain requirements | EmissionPlan |
| 2.3 | Render | text. Formatting only -- no decisions | RenderedFile |

After #1928 (PR #1996), 2.2's planned blocks carry their own requirements: float-assert-c11 and the four critical-* keys, read off the plan. Every other requirement key is still decided and recorded inside 2.3 Render, at the branch that emits the text:

key recorded at (0cd96994b)
baseline-c / baseline-cpp CodeGenWalker.ts:1593, every file, from cppMode
cpp-designated-initializer CodeGenWalker.ts:3262
cpp-compound-literal CodeGenWalker.ts:3300
overflow-panic-hosted-libc HelperGenerator.ts:57, for the debug clamp helpers that the plan's clampOps already decides
atomic-ldrex-cmsis AtomicGenerator.ts:113, a requires effect recorded by CodeGenerator.applyEffects (CodeGenerator.ts:160)

Until #1996, one comment recorded this gap, on CodeGenWalker.addGeneratedHelpers: "the banner also carries requirements this plan does not yet own (the mode baseline, C++ initializer forms, atomics)". #1996 deletes that comment, because its first half (the copy) is fixed. Its README edit then describes the split as the design: "which toolchain features a run's Render emitters required (a 2.2 planned block's features are 2.2's decision, read off the plan, #1928)". That edit contradicts §1's table in the same file.

This is not a parallel path, because each key has one author. It is an ownership divergence: §1 names 2.2, and the code uses 2.3. No open issue tracked it. I searched all 487 open issues on 2026-10-11 for the key names, ToolchainRequirements, requireToolchain and "toolchain requirement". Found while reviewing #1996.

Reproduction

git grep -n 'ToolchainRequirements.record(\|type: "requires"' 0cd96994b -- src ':!**/__tests__/**'
git show 0cd96994b:docs/architecture/README.md | sed -n 45,46p

The first command prints the Render sites in the table above. It also prints CodeGenWalker.ts:1921 (registerPlannedToolchain), which #1996 deletes.

Decision needed

  • (a) 2.2 decides these too. Each key becomes part of the plan, as the planned blocks' keys already are, and Render records no requirement.
  • (b) §1 is amended to say who authors a requirement whose existence depends on the form Render emits. The 2.2 row then names the planned blocks' requirements only.

Definition of done

  • The decision above is recorded on this card.
  • Under (a): git grep -n 'ToolchainRequirements.record(\|type: "requires"' -- src ':!**/__tests__/**' prints no Render site. A mutation that drops one migrated key from the plan turns a banner fixture red.
  • Under (b): §1's Ownership table and its instrumentation/ bullet agree on who authors each requirement key.

Activity

  1. added
    tech-debtInternal codebase or process debt, not a C-Next language defect
    on Oct 11, 2026
  2. added a commit that references this issue on Oct 11, 2026
  3. added this to the v0.3.2 milestone on Oct 11, 2026
  4. devin-ai-integration commented on Oct 11, 2026

    @devin-ai-integration
    Contributor

    Decision: (a). Owner direction, 2026-10-11. I proposed that §1 already decides this (its Ownership table gives 2.2 "toolchain requirements", and 2.3 is "formatting only -- no decisions"), so (a) applies unless he said otherwise. He answered "make it so".

    Starting work on refactor/1997-plan-owns-requirements. Approach:

    • Render no longer records requirements. It reports the form it emitted, as an emission fact: a designated initializer, a compound literal, or an LDREX/STREX loop (with its site). It says nothing about what that form costs.
    • IEmissionFacts gains those facts plus debugMode, and EmissionPlan.build decides each key:
      • baseline-c/baseline-cpp from cppMode
      • cpp-designated-initializer and cpp-compound-literal only in C++ mode
      • overflow-panic-hosted-libc when the plan has clamp helpers and the run is in debug mode
      • atomic-ldrex-cmsis, with its sites
    • getToolchainRequirements() reads the plan alone. ToolchainRequirements.record, collect and the recorded map are deleted.
    • Generated output must be byte-identical. A mutation that drops one migrated key from the plan must turn a banner fixture red, with a fixture not using that key as the control.

    Written by Devin

  5. added a commit that references this issue on Oct 11, 2026
  6. devin-ai-integration commented on Oct 11, 2026

    @devin-ai-integration
    Contributor

    Box 2 evidence, at fea657d94 on refactor/1997-plan-owns-requirements:

    • git grep -n 'ToolchainRequirements.record(\|type: "requires"' -- src ':!**/__tests__/**' prints nothing (exit 1). record, collect and the recorded map are deleted. Render now reports only the form it emitted: emittedDesignatedInitializer, emittedCompoundLiteral, and an ldrex-strex-loop site. EmissionPlan.build decides each key into formRequirements. getToolchainRequirements() returns EmissionPlan.requirements(plan) alone.
    • Generated output is unchanged on tests/issue-502 (9 passed), tests/atomic (11), tests/issue-522 (2) and tests/bit-indexing (13), and the tree is clean afterwards. CI runs the full suite.
    • Dropping a migrated key from the plan turns banner fixtures red:
      • I removed the cpp-compound-literal push. tests/issue-502: 7 passed, 2 failed. The banner lost compound literals in C++. Control tests/bit-indexing: 13 passed.
      • I made the atomic-ldrex-cmsis branch unreachable. tests/atomic: 3 passed, 8 failed. Control tests/issue-502: 9 passed.
      • No fixture runs in debug mode, so overflow-panic-hosted-libc is pinned by a unit test in EmissionPlan.test.ts. I made the key ignore debugMode, and that test failed (1 failed, 219 passed).
      • After restoring the code, all three directories pass again and the tree is clean.

    Written by Devin

  7. added a commit that references this issue on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tech-debtInternal codebase or process debt, not a C-Next language defect

Projects

  • Status
    WIP

Relationships

None yet

Development

No branches or pull requests

Issue actions