Repository navigation
The C cases link without DWARF: the testcases ROOT goes from 305 to 209 MiB, and the checkout-path issue records the paths every guest binary carries - #806
Conversation
Each C case is a static PIE clang links against libtoyos_c.a, libc's staticlib, and its Rust libraries' DWARF came along: 0.70 MiB in each of 137 cases, 96.48 MiB of the testcases ROOT's 305 MiB, written on every T14 flash. [profile.toyos] strips DWARF from every Rust guest binary (strip = "debuginfo"); the C link now does the same with -Wl,--strip-debug and keeps .symtab, which symbolize and the kernel's dlopen binding read. Nothing reads a C case's DWARF: libc's panic handler prints no backtrace, no code in the tree outside the rust fork names a .debug_ section, the kernel's and symbolize's frames come from .symtab, ccheck compares stdout, and 112_backtrace, the corpus's one backtrace case, is declined in NOT_RUN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
The issue said snake carries no path. Measured at a944746, by reading each file back off the staged testcases ROOT and the cargo run ROOT and counting occurrences of the home directory's prefix: every guest binary carries the absolute path of the checkout that built the sysroot store's std and C library (panic locations of toyos, toyos-abi and toyos-osrelease), 45 test_rs binaries and libtls_cranelift.so carry the building checkout's own path (tests/toyos-rust-tests is a workspace of its own), and every guest binary, the kernel and the bootloader carry the cargo home's path. The kernel and snake carry no path into the checkout that built them, which is what the two-checkout comparison the issue records varied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
|
The measurement behind the body: method, tool and per-kind sums. Paths to the home directory are masked. ROOT's file list is the staging run's own Sumsbefore ( after ( Paths under the home directory,
|
…carries them Without DWARF a C case carries 23 paths into the checkout that built the sysroot's std and C library, all in .rodata; the 24th was its .debug_str's compilation directory, which the strip removes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
|
Review, round 1, head Net lines ( I checked the issue's counts against the implementer's BLOCKER
NOTE
SEND BACK |
|
Review, round 2, head Net lines ( Round 1's blockers
BLOCKERNone. NOTENone. LAND |
|
CI at |
Main brings the app grants (#807) and the C cases linked without DWARF (#806); neither touches what this branch changes, and the merge is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
The C test programs are now linked without DWARF, the same way
[profile.toyos]links every Rust guest binary. They keep.symtab. On the T14testcasesimage, ROOT shrinks from 305.00 to 209.00 MiB and the whole image from 410 to 314 MiB. The checkout-path issue was also corrected: every guest binary carries absolute host paths, includingsnake, which the issue said carried none.What changed and why
tests/common/compile.rs:link_toyospasses-Wl,--strip-debug. Every C program the harness links goes through it: the 137 corpus cases andtests/netcase's threelibc_socketsprograms.libtoyos_c.abrought its Rust libraries' DWARF into each case, 0.70 MiB per case and 96.48 MiB in total, and nothing read it. The.symtab/.strtabsum (44.05 MiB) and the.textsum (56.31 MiB) are the same to the hundredth of a MiB before and after. So the linker dropped only the debug sections. One link step for every C program, so no second path. The strip is at the link, the same place rustc strips a Rust binary (strip = "debuginfo"). This also makessrc/qemu.rs's header true for C programs: "every guest profile strips it at the link".issues/two-checkouts-of-one-tree-build-different-guest-bytes.md: now matches what was measured. Paths are named here by kind, never by their characters.toyos,toyos-abiandtoyos-osrelease. That is all 250 ELF files on thetestcasesROOT (23 in each C case once stripped) and all 27 programs on thecargo runROOT (6 insnake).test_rs_*binaries andlibtls_cranelift.socarry the building checkout's own path, becausetests/toyos-rust-testsis a workspace of its own.snakecarry no path into the checkout that built them. That is what the issue's two-checkout comparison varied, so its symbol counts still stand as recorded. They were not re-measured here.LC_ALL=C grep -a -o "$HOME/" <binary> | wc -l. It gives 42 forsnake(6 + 36), 7 for the kernel and 40 for the bootloader, run on this worktree'starget/files.Does anything read a C case's DWARF? No.
libc's#[panic_handler]printslibc panic: {info}and exits 134. It prints no backtrace. A C case carries nogimlioraddr2line. With the strip, its only home-directory paths are 23 into the sysroot-building checkout and one into dlmalloc in the cargo home, all in.rodata. The 24th checkout path was.debug_str's compilation directory, which the strip removed.gimli|addr2line|debug_line|debug_info|.debug_|dwarfoutsiderust/finds no reader. Its only hits aresrc/qemu.rs's "There is no DWARF" header andPT_GNU_EH_FRAMEcomments.symbolizename frames from.symtab(kernel/src/loader/symbols.rs,src/qemu.rs's header). The kernel's dlopen binding reads the executable's.symtab. Both are kept.ccheckcompares stdout with.expect. The corpus's one backtrace case,112_backtrace, is declined inNOT_RUN: it is a meta-test of tcc's-bruntime.Measured: ROOT before and after
The method is #804's. The
testcasesimage is staged with--metal-readback … boot:testcases --nocapture, and ROOT's files are taken from that run's ownroot: addinglines (389 files, the same list both times). Each file is read back off the image throughtoyos_build::image::root_file_on, and its ELF section headers are summed. ROOT's extent comes from the image's slot and partition tables. The tool, the per-kind sums and the path counts are in the comment on this pull request.a944746d5)bb036abef).symtab+.strtab.textFlash time: not separable on this base. This base has no phase timing (#804 adds it), so the T14 run below records no
flash_secs. #804's reading at52bb3de20flashed 430,964,736 bytes in 66.6 s of dd, about 0.155 s per MB; the 100.7 MB cut is therefore about 15.6 s per flash by that rate. That is an estimate, not a reading, and the earlier "about 27 s" in this body was arithmetic on a wrong rate. What the T14 run did measure: thetestcasesboot's driver time outside the boot itself (wall time minusback_secs) was 90 s, against 101 s for #804's unstripped image the same afternoon; one boot against one boot, so no timing verdict.Gates (head
bb036abef)cargo run -- --ci host(78 steps), at8d9179496and again atbb036abefcargo run -- --build-only(at38c8fac04: the same tree minus the issue file)cargo testat8d9179496(the guest suite, once;bb036abefchanges only three lines of the issue file, which no guest test reads: 38 passed of 38;uptimeload averages 55.56/38.78/31.24 before and 78.89/67.67/48.02 after)cargo test --test toyos-build -- --metal --metal-readback <scratch>/cstrip/metal/ boot:testcases(stages only; touches no machine)Stagedverdict by designClosing lines of each gate's log: host
15:03:30 [ci] Host: 78 step(s), all green/EXIT=0(atbb036abef); guest suitetest result: ok. 38 passed, 38 total (302.9s; …)/EXIT=0(at8d9179496), withlibc_socketsamong the 38; staging[toyos] Compiling 137 C tests, and attempting 24 declared ones...then[metal] staged 2 image(s)/EXIT=2.What the guest suite reaches, and what it does not. At this base the QEMU suite does not run the C corpus. Its shared boots are metal-only now: the 38 tests include no
testcasesshared boot, and the suite's log has noCompiling … C testsline. The suite reaches this change throughlibc_sockets(PASS), which linkstests/netcase's three C programs throughlink_toyos. The corpus itself was compiled and linked through the new flag on the host when the image was staged.check_not_run's declared stages all held, or the staging would have panicked.T14
boot:testcasesatbb036abef, run by the orchestrator. Images as staged here, each hash checked againstrequest.txtbefore its flash (testcases63f1eb53…04713855,testcases-watchdogd24014d0…92844a928); eachtoyos-metal --image <img> --readback <dir> --fat32-checkexited 0 with verdictpassed. Judgecargo test --test toyos-build -- --metal --metal-readback <dir> boot:testcases: EXIT=0,[metal] 248 passed, 0 failed, 2 boot(s).spawn: /system/bin/<case>) with the comparator's verdict (ccheck: <code>): 137 cases, every oneccheck: 0(its output matched its.expect), and the 137 names with their codes are identical to those of toyos-metal writes where each boot's wall time went into boot.txt, and the judge prints it #804's unstrippedtestcasesboot at52bb3de20(main8dbccd3ab, the same corpus asa944746d5): no member went red.back_secs134 (testcases) and 77 (testcases-watchdog), against 104 and 65 in toyos-metal writes where each boot's wall time went into boot.txt, and the judge prints it #804's boots: slower, from one boot each; stripping DWARF from programs the boot runs does not plausibly cost 30 s, but no measurement here says why.Negative control. The before arm is the base
a944746d5with the change absent. It was staged and measured in this session with the same tool (96.48 MiB DWARF, ROOT 305.00 MiB).No mutation. The change is one flag. Its effect is the measured byte delta, and the base arm above is the arm without it.
Images staged for the T14, sha256:
testcases:63f1eb5363929aa0d7cc01fb129a91f125961d46eb1a7af74f52528004713855testcases-watchdog:d24014d01707ec11dcace9ba93472aeb2d71b38015b56d378d2b08492844a928Net lines (
git diff --shortstat origin/main...HEAD): 2 files, +31 −4. Production: none. Harness:tests/common/compile.rs+6, one flag and its doc. The issue: +25 −4.What I am unsure of
flash_secsgives it on the firsttestcasesboot after both land.cargo runROOT's path counts were taken at38c8fac04. Its guest sources area944746d5's, because this branch touches no guest source.🤖 Generated with Claude Code
https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C