Repository navigation
docs: phased implementation plan for GPT-5.6 handoff - #3
Merged
Merged
Conversation
Adds docs/plan/ — a 10-document, execution-ready plan covering the batch linker (phases P0-P5) and incremental linking (I0-I7), written for an implementing agent that follows instructions precisely rather than planning. Grounded in analysis of wild, mold, and radlink (shallow-cloned to .extern-repos/, now gitignored) plus a survey of incremental-linking prior art (Zig, MSVC /INCREMENTAL, gold, HP-UX, Sun ild, Live++). Key locked decisions: fork wild rather than reimplement; windows-gnu before windows-msvc to defer PDB; generalize wild's ELF relocation vocabulary rather than fork it; adopt radlink's synthetic-object architecture for imports; semantic differential testing rather than byte comparison. Two contradictions in DESIGN.md are surfaced for resolution: peak-RSS as a win category conflicts with the resident daemon that millisecond warm relinks require, and archive semantics — which wild's incremental design excludes by targeting Rust — are unavoidable for a C/C++ linker. Co-Authored-By: Claude <[email protected]>
4 of 54 tasks
LTO was listed as a project non-goal in DESIGN.md and README.md. It is actually a stretch goal, deliberately sequenced after the fast linker on all three platforms — the inner loop is the priority and LTO touches nearly every subsystem. Adds DESIGN.md §3.1 and a README stretch-goals section, and records the sequencing as D13 with its consequences: do not delete wild's inherited linker-plugin LTO; reject LTO flags with a specific diagnostic rather than a silent mislink until implemented; /GL objects must hard-error since they contain IL rather than machine code. Co-Authored-By: Claude <[email protected]>
Six reviewers attacked the plan: internal consistency, wild-fork feasibility (source-verified), PE/COFF + MinGW (measured on the local MSYS2 toolchain), Mach-O, incremental soundness, and the test oracle. The plan does not survive unamended. D10 (reject auto-import) is refuted by measurement — plain g++ hello-world requires runtime pseudo-relocs. The "-m i386pep selects COFF" acceptance criterion is architecturally impossible in wild's arg design. And the plan is unaware of wild's fourth backend, Wasm, which it would inherit at ~6,650 LOC. Co-Authored-By: Claude <[email protected]>
The most consequential finding of the whole review: I2, scheduled as "the first shippable win," targets ~5% of link time. Published phase data for lld on clang RelWithDebInfo puts input parsing at 5.04% and string merging at 66.54%, corroborated independently by wild's own benchmark page. A daemon caching parsed inputs skips the 5% and repeats the 66%. String merging is also a soundness hole: the I1 resolution fingerprint is structurally blind to SHF_MERGE offset shifts. Test oracle: linker-diff's non-ELF failure mode is silently green, its coverage is ~50-70% of relocations even on ELF, and the 18-directive freeze is mutually exclusive with adopting wild's 213 fixtures. Mach-O: __unwind_info must be linker-constructed and appears nowhere in Phase 4; MH_PIE/hard __PAGEZERO/MH_DYLDLINK/LC_MAIN are kernel- or dyld-enforced and unlisted. Co-Authored-By: Claude <[email protected]>
…arlier D3 revised: windows-msvc before windows-gnu. The original ordering priced only the debug-info axis and priced MinGW compatibility at zero. radlink is an in-tree MSVC-target reference; MinGW's auto-import, default-script emulation, .rsrc and .CRT$X* requirements are all where it gives zero help. D10 revised: auto-import and runtime pseudo-relocs are REQUIRED, not rejectable. Refuted by measurement on the local MSYS2 toolchain. D14 added: delete wild's Wasm backend (~6,650 LOC, 2 CI jobs) in P0. D15 added: the first incremental phase moves ahead of P4/P5, on ELF alone. Its content is flagged as an open item pending measurement — see R25. Co-Authored-By: Claude <[email protected]>
Applies the decisions taken after adversarial review: - D3 revised: windows-msvc leads and carries the COFF core; MinGW becomes an additive phase. Docs 05 and 07 swapped and re-split accordingly. - D14: delete wild's Wasm backend in P0 (~6,650 LOC, 2 CI jobs) — the plan was unaware it existed, so every "add an arm" count was off by one. - D15: the incremental workstream moves ahead of P4/P5, on ELF alone. - D16: IX-T0 gates it — measure the per-phase split before designing a daemon. Caching parsed inputs targets ~5% of link time; string merging is ~66%. - D17: oracle coverage floor plus one malfunction site per format, because linker-diff's non-ELF failure mode is silently green. Also adds the tasks review found missing: P0-T0 Linux dev container (all P0-P2 acceptance is unrunnable on the Windows dev host), P0-T7 multi-call driver binaries, P0-T8 workflow reconciliation, P4-T2b kernel/dyld invariants, P4-T5b __unwind_info construction, P4-T5c static initializers, P4-T8b rustc flags, coff_writer.rs, and the COFF linker-diff instantiation. Co-Authored-By: Claude <[email protected]>
7 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.
Adds
docs/plan/— a 10-document execution-ready plan covering the batch linker (P0–P5) and incremental linking (I0–I7), written for an implementing agent that follows instructions precisely but does not plan.Grounded in file-level analysis of
wild,moldandradlink, plus a survey of incremental-linking prior art (Zig, MSVC/INCREMENTAL, gold, HP-UX+ild, Sunild, Live++).Locked decisions
Two contradictions in DESIGN.md surfaced for resolution
Notable findings
todo!()s, arm64-only, feature-gated off. We do not inherit a working Mach-O..eh_frame_hdr/.pdata/__unwind_info) is what killed gold's C++ support, and it is identical on all three target formats.🤖 Generated with Claude Code