Repository navigation
test(linux): add the scheduled >2 GiB ELF output scale gate (reld#16) - #159
Merged
Merged
Conversation
The per-PR Phase 2 gate covers >64K sections and >64K relocations; a >2 GiB output cannot join them because its inputs alone are gigabytes. This runs it weekly instead, and records the deferral in docs/plan/08-ACCEPTANCE.md rather than leaving it as prose. `ci/scale_gate.py` builds the payload as assembly, so 2.25 GiB of `.rodata` costs an assembler rather than a compiler chewing a multi-gigabyte initializer, links it through clang with `--ld-path`, then validates every section and segment offset against the real file size, executes the result, and records peak RSS, wall time, output size, runner image, and reld commit. The first run found why this is not a C fixture: the distributed crt objects are built for the small code model, and 2 GiB of payload pushes `crtbegin.o`'s `R_X86_64_32S` out of range before reld's layout is exercised at all. That is the C runtime's code model, not the linker, so the fixture is freestanding and exits by syscall. Structural validation is Python rather than a `readelf` call so it names the field that is wrong and can be unit tested without building 2 GiB. Those tests run on every PR. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
11 of 20 tasks
…r mark `getrusage(RUSAGE_CHILDREN)` is cumulative across every child the process has ever reaped, so after assembling 36 sixty-four-megabyte objects it reported whichever assembler run peaked highest rather than the link. `os.wait4` gives the rusage of one specific child. Measured difference on the same 2.25 GiB link: 138 MB reported before, 70 MB actually used. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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 #16. Wave 2 of #153.
Why scheduled
The per-PR Phase 2 Linux gate covers >64K sections and >64K relocations. A >2 GiB output cannot join them — the inputs alone are gigabytes — so it runs weekly from
.github/workflows/scale-gate-linux.yml, anddocs/plan/08-ACCEPTANCE.mdsection 4b now records the deferral with a link to this issue instead of leaving it as prose.What it does
ci/scale_gate.pygenerates 36 × 64 MiB.rodatachunks as assembly (.fill, so the size costs an assembler rather than a compiler chewing a multi-gigabyte initializer), links them throughclang --ld-path=reld, and then:p_filesz <= p_memszonPT_LOAD— a truncated or wrapped field is reported as the specific field that is wrong;The first run found something
A C fixture does not work here. The distributed crt objects are built for the small code model, and 2 GiB of payload pushes
crtbegin.oout of range before reld's layout is exercised at all:That is the C runtime's code model, not the linker, so the fixture is freestanding:
-nostdlib -static,-mcmodel=large, and an exit syscall.Verification
Run end-to-end locally against
target/release/reld:{ "output_bytes": 2415922919, "executed": true, "link_wall_seconds": 0.73, "link_peak_rss_bytes": 138448896, "extra": { "sections": "10", "segments": "6" } }2.25 GiB of output, structurally valid, ran and exited 42.
The gate's own logic is unit tested in
ci/tests/test_scale_gate.pyagainst hand-built ELF bytes — truncated section, truncated segment, overflowedp_filesz,SHT_NOBITScorrectly ignored, non-ELF input, sizing — so a validator that stops catching truncation fails on a PR rather than a week later.uv run --no-sync python -m pytest ci/tests -q: 267 passed.🤖 Generated with Claude Code