Repository navigation
code_objects: say which question the count answers, since a drop needs both checks - #1463
Conversation
…s both checks Comment-only. tools/code_objects.py answers "does this ELF carry AMDGPU code objects"; it does **not** answer "are the private kernels in this build", and a reader could conclude otherwise -- at which point the addon-symbol test beside it in make-binary-drop.sh looks redundant and someone deletes it. Measured on this box: a tree configured -DONEBIT_HRX=ON with ONEBIT_GPU_PRIVATE empty produces a libggml-hrx.so of 5,615,208 B with 5 ELF headers and 4 EM_AMDGPU images -- it passes the count and carries none of the private addon. Across the four libraries I measured, the addon symbol separated them (yes/no/yes/...) where the count did not (54/49/2/4). Both checks are needed: the count says the file carries HIP code at all, the symbol says it is the kernels the drop promises. Also notes in tests/code_objects_test.py that its case 3 (a 5.1 MB build with no code objects) is a different thing from an ONEBIT_GPU_PRIVATE-empty build, which carries four. tools/code_objects.py --check-equivalent and tests/code_objects_test.py both still pass (0 failures), the tool returns 4 for that control library as before, tools/copyright.py --check rc 0.
|
#1463 ready for review at 5b23828 Comment-only, +10/−1, two files. Guard for a check that is easy to misread now that #1443 is fixed.
Not hypothetical: the negative control I built for #1443 ( Also one clause in
|
|
/review |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 5b238289960ff30dd1db01f587e7e9ddc4e714da.
Comment-only, and the comment is worth more than the code it annotates: it records a measurement that stops a future reader from deleting a check as redundant.
ONEBIT_HRX=ON with ONEBIT_GPU_PRIVATE empty: 5,615,208 B, 5 ELF headers, 4 EM_AMDGPU images
-> passes tools/code_objects.py (it does carry AMDGPU code objects)
-> carries none of the private addon
So "this ELF carries AMDGPU code objects" and "the private kernels are in this build" are different questions, and only the nm -D … ggml_hrx_hip_addon_register test beside it answers the second. Saying so in place — where someone would be tempted to see two checks for one thing — is the cheapest possible guard, and it is the third time this week that a comment has been the fix for a defect that a deletion would have caused.
The diff is comments in both files (the test's changed line is prose), so no behaviour to review.
…row keeps them off (Fixes #1474) (#1544) * os: the BASE layer's group/other-writable modes are taken off, and a row keeps them off (Fixes #1474) The payload class (#1352/#1361/#1360/#1435/#1459/#1461/#1463) is closed for opt/1bit-package; this is the same class one layer down, which none of those rows looked at. Measured on the base SFS this pass: **2,176** group/other-writable paths outside the payload (1,814 files + 362 dirs), **2,166 of them outside a keep-list** - 352 directories, 542 executables, 1,272 other files, all inherited from woof-CE's build with the builder's umask. * `pack_normalise_base_modes` / `pack_writable_base_files` in scripts/pack-elf.sh, beside the payload pair. The normaliser applies **go-w ONLY**. The payload's rule (dirs 0755, executables 0755, other files 0644) is right for a package and wrong for an operating system: it GRANTS bits, and it would have made /etc/shadow and /etc/gshadow world-readable and every 0600 private key readable. The base layer has all of the secrets the payload does not. * `os/v3/puppy/base-modes-keep`: the eight classes that DO need to stay writable (tmp, var/tmp, var/run, var/lock, var/spool, var/log, run, dev, proc, sys) plus opt/1bit-package (the payload has its own normaliser and its own row). A prefix covers the path itself, so /tmp keeps 1777 rather than losing its sticky bit. * `scripts/base-modes.sh`: the CLI (`<tree>` normalises and self-checks, `--report-only` prints what is dirty). * applied in `os/v3/puppy/fix-ownership.sh`, the hook 3builddistro calls immediately before mksquashfs - the last moment the tree exists, and the same place that already refuses to pack when the setuid count moves. * `base_modes_verdict` + the `base-modes` row in os/mini/release-check.sh: counts the root filesystem outside the keep-list, PRINTS the keep-list that decided it (a silent change to that list is what a row should make visible), and the keep-list ships at /etc/1bit/base-modes-keep so the row judges against the machine's own copy. Six self-test arms. * `tests/base_modes_test.sh`: 16 arms, including the two that would have caught my own first version - a 0640 file stays 0640 and a 0700 directory stays 0700 (the normaliser must never widen), and `var/logrotate` is not kept by `var/log`. Boot proof on the real base tree: normalised (2,166 paths, 193 kept) -> mksquashfs with woof-CE's options -> mkimage.sh -> vm-check.sh: **77 PASS / 0 FAIL / 4 SKIP** (the 4 are structural: ssh key, two board rows, a second disk). After the run the reporter says clean and the bits that matter are untouched: etc/shadow 600, etc/gshadow 600, etc/sudoers 640, usr/bin/passwd 4755, tmp 1777, dev 775. * os: patch-sfs can normalise the base layer as it packs, so a CYCLE cut gets the fix too (#1474) The previous commit put the normaliser in fix-ownership.sh, which runs for a full woof-CE build. A cycle does not build: it unpacks the previous SFS, replaces a few paths and repacks - and that is what ships. `patch-sfs.sh --keep-modes <keeplist>` now normalises BOTH trees immediately before mksquashfs (the artifact IS $work/new), which keeps the declared-set metadata proof honest - the same transformation on each side means a mode line that differs is still a difference the patch made - and it refuses the packed SFS if the verify tree is still writable outside the keep-list. Measured on a fixture: `changed.txt` 664 -> 644 in the artifact, `other.txt` 775 -> 755, the keep-listed `usr/bin/kept.sh` stays 775, and the run ends "base modes: the packed SFS is clean outside keep.txt". `tests/patch_sfs_atomic_test.sh` still 11/11 (the flag is opt-in; without it a cut behaves exactly as before). The first attempt put the block after the pack, which the tool's own verify check caught as 'modes/owners/types/sizes are not the packed tree's' - the artifact had the un-normalised modes. * os: the base-modes row can be pointed at a tree, so it can be tested off a board (#1474) A row that can only be judged by booting an image cannot be tested - and this one was written with no way to run it. It now takes `BASE_SCAN_ROOT=<tree>` (the same trick the payload row already uses with `PAYLOAD_DIR`), with the prunes relative to that root, and it was checked both ways before the commit: the un-normalised base SFS tree reports 40+ writable paths (FAIL) and the normalised tree reports 0 (PASS). The boot-based check stays what the row does on a machine; this only makes it possible to run the scan without one. * os: the base-modes row counts the whole set, and its prune list comes from the keep-list (#1544 review) Two defects in the row, both real, both cheap: 1. `find ... | head -40` ran BEFORE the count, so `_bm_n_paths` was min(actual, 40): on the base layer this row exists for (2,176 writable paths) the failure sentence would have read "40 path(s)" - a 50x understatement in the one line a reader uses to judge severity. The find writes to a temp list, the count is `wc -l`, and only the SAMPLE is head-ed. 2. the prune list was a hand-copy of the keep-list, in a comment that claimed they were one thing. The next cycle to add a keep-list entry would have had no prune for it and the row would have failed on a path the keep-list explicitly allows, while the PASS branch printed that list as "the keep-list" that decided. The prune is now BUILT from the keep-list, and the four paths pruned for a different reason (`data initrd mnt media` - not part of the OS image) are named separately. Checked off-image with `BASE_SCAN_ROOT` (no boot needed): a fixture with 60 writable files and 7 writable directories now reports **67**, where the old row said 40; adding `big/` to the keep-list drops it to **65** with no other edit, which is the property the hand-copied list did not have. Also: the self-test's keep-list size is 11 (the shipped file's count, was 10), and the note about a zero-sized keep-list says where that case is covered (the row SKIPs on a missing file; an empty one is a repository error, not a machine state). --------- Co-authored-by: bong-water-water-bong <[email protected]>
Comment-only, two files, +10/−1. No issue to close: this is the guard for a check that is easy to misread after #1443.
The reading that would break the drop
tools/code_objects.pyanswers "does this ELF carry AMDGPU code objects". It does not answer "are the private kernels in this build" — and a reader who concludes it does would then look at thenm -D … ggml_hrx_hip_addon_registertest directly above it inmake-binary-drop.shand see redundancy. Deleting it would let a drop ship with no private kernels while the gate stays green.Why that is not hypothetical
Measured on this box (the negative control I built for #1443, so the fail side of the gate exists rather than being assumed):
EM_AMDGPU~/wt/rlk-build~/wt/tprs-hrx-154~/wt/nohrx-build—ONEBIT_HRX=ON,ONEBIT_GPU_PRIVATEemptyThe last row passes the code-object count while carrying none of the private addon. Across the four, the addon symbol separates them (yes/yes/no/no) and the count does not (54/49/2/4 — the control overlaps the small build).
What the commit says, where
tools/code_objects.py— a "what this does not answer" paragraph with the control's numbers, and the division of labour: this tool says the file carries HIP code at all; the addon symbol says it is the kernels the drop promises. Keep both.tests/code_objects_test.py— case 3's note gains one clause: its 5.1 MB fixture (0 code objects) is a different thing from anONEBIT_GPU_PRIVATE-empty build, which carries four. The existing case is right about its own file; it just should not be read as "an unprivileged build looks like this".Checks
python3 tests/code_objects_test.py→0 failure(s); the tool still returns4for the control library;python3 tools/code_objects.py --helpunaffected;tools/copyright.py --checkrc 0; no code path changed, so nothing else can regress.0 s GPU, 0 s NPU, no ticket, nothing merged.