Repository navigation
fix(core): f32_bits_tests reads its ECE fixture at run time, so the published crate compiles - #5179
Conversation
…ublished crate compiles src/metrics/f32_bits_tests.rs did include_str! of scripts/setfit_fixtures/claims_stats/ece_top_label_cases.json, a file outside aprender-core, so the packaged .crate could not compile the lib's unit tests (scripts/package_tarball_build.sh red). It now reads the file through provable_contracts::workspace_file_or_skip!, the shared rule test_support already uses: in tree a missing file panics; out of tree the ECE half prints a named SKIP and the f1 half still runs. The frozen snapshot table is unchanged. Refs #5171 Agent: aprender-wmainred Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
noahgift
left a comment
There was a problem hiding this comment.
APPROVE seat 2, w71-e3b, 5e9574f
Read the one-file diff at 5e9574f. Its base is the main tip.
- The fixture now goes through
provable_contracts::workspace_file_or_skip!(aprender-contractstree.rs). In tree, a missing or unreadable file panics. Only an out-of-tree (published) build skips. So the in-tree run still checks the frozen ECE table. provable-contractsis already a versioned dev-dependency of aprender-core (#4175), and ship_001/003/004 use the same macro. No manifest change is needed.- The f1 half runs before the early
return, so a tarball build still checks it. The#[ignore]regenerator'sunwrap_or_default()only matters out of tree. - One check is still open: the body's GREEN
package_tarball_build.shline on this head is not posted yet. I did not run the build myself; this is a static review.
…shrink report counts the skip (#5171) The tarball shrink report counts skip sites by `*_or_skip(` calls; the macro form `workspace_file_or_skip!(` did not match, so the new out-of-tree skip was invisible to the line that is meant to show every place a published test surface shrinks. Same rule, same panic in tree; only the call form changes. Refs #5171 Agent: aprender-wmainred Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
noahgift
left a comment
There was a problem hiding this comment.
APPROVE seat 1, aprender-a7n, 5e9574f
Read at head 5e9574f (one file, +14 -8):
- The
include_str!of a workspace file outside the crate is replaced by a run-time read throughprovable_contracts::workspace_file_or_skip!, the same helperformat/ship_00*.rsandprovenance_tests.rsalready use (#4130/#4175).provable-contractsis a versioned dev-dependency of aprender-core, so it survivescargo package. - In tree the fixture is present and the snapshot test still asserts
ece.len() == ECE_SNAPSHOT.len()and every bit pattern; the skip path is reached only out of tree, after a named SKIP. No assertion is weakened. print_f32_snapshotusesunwrap_or_default(); it is a print helper, not a check.- The tarball gate RED on main cc71bde and GREEN on this head are the author's measurement (body + inbox), not re-run by me.
This seat binds to 5e9574f only. If the follow-up commit routing the skip through a *_or_skip fn is pushed, the head moves and this seat must be re-posted on the new sha.
noahgift
left a comment
There was a problem hiding this comment.
APPROVE seat 2, w71-e3b, 9939c9c
I re-read the delta 5e9574f..9939c9c (2 files, +9/-2). The ECE read now goes through a new test_support::workspace_fixture_or_skip, a thin pub(crate) fn over the same provable_contracts::workspace_file_or_skip!:
- In tree, a missing fixture still panics; only an out-of-tree build skips.
- The macro's
CARGO_MANIFEST_DIRis still aprender-core. test_supportis#[cfg(test)](lib.rs:185), so the new fn does not add dead code to a non-test build.
The body now carries the GREEN package_tarball_build.sh line on this head: 73/73 tarballs compile their tests, and aprender-core has 13 skip sites. My earlier note is resolved. Static review.
noahgift
left a comment
There was a problem hiding this comment.
APPROVE seat 1, aprender-a7n, 9939c9c
Re-seat on the new head; my seat on 5e9574f no longer applies.
Delta 5e9574f..9939c9c read in full: the run-time read now goes through crate::test_support::workspace_fixture_or_skip, a plain fn wrapping the same provable_contracts::workspace_file_or_skip!, next to the existing workspace_contract_or_skip. env!("CARGO_MANIFEST_DIR") in the macro still expands inside aprender-core, so path resolution is unchanged. The only behaviour change is that the shrink report can now count this skip site (12 -> 13). Every assertion I noted on 5e9574f still holds: in tree the fixture is read and every snapshot bit is compared, and the skip is reached only out of tree.
The tarball gate RED (main) / GREEN (this head) figures are the author's measurement, not re-run by me.
|
§13.11 rung 1 — quorum shadow verdict Shadow mode: this records a verdict and merges nothing. A refusal |
What
0.71.1 row P2. aprender-core's published .crate cannot compile its lib unit tests:
src/metrics/f32_bits_tests.rs:22didinclude_str!ofscripts/setfit_fixtures/claims_stats/ece_top_label_cases.json, a file outside the crate.The fixture is now read at run time through
crate::test_support::workspace_fixture_or_skip, a plain fn over the shared ruleprovable_contracts::workspace_file_or_skip!(#4130/#4175). It is a fn, not the macro, so the tarball shrink report (which counts*_or_skip(calls) lists this skip site. In tree, a missing or unreadable fixture panics. Out of tree, the ECE half prints a named SKIP, and the f1 half still runs. The frozen snapshot table is unchanged. Two files change.RED before / GREEN after:
scripts/package_tarball_build.sh(x86_64)RED on main cc71bde, rc 1:
GREEN on 5e9574f, rc 0:
GREEN on 9939c9c (the skip-count follow-up), rc 0:
On 5e9574f that line read 12: the macro form
workspace_file_or_skip!(is not counted by the report, so the follow-up routes the read through a fn. The +1 is this skip.In tree (aarch64, 5e9574f)
cargo test -p aprender-core --lib metrics::f32_bits_tests: 1 passed, 1 ignored (the regenerator), rc 0, with no SKIP printed, so the ECE half ran against the fixture.rustfmt --checkis clean.Refs #5171
keep-open: #5171 stays open until the 0.71.1 release run's tarball gate is green on aprender-core
ont-delta: none — a test-only change to how a fixture is read; no type, shape or contract change
🤖 Generated with Claude Code