Skip to content

fix(core): f32_bits_tests reads its ECE fixture at run time, so the published crate compiles - #5179

Merged
noahgift merged 2 commits into
mainfrom
fix/5171-f32-bits-fixture-runtime
Oct 12, 2026
Merged

noahgift merged 2 commits into
mainfrom
fix/5171-f32-bits-fixture-runtime

Conversation

@noahgift

@noahgift noahgift commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

0.71.1 row P2. aprender-core's published .crate cannot compile its lib unit tests: src/metrics/f32_bits_tests.rs:22 did include_str! of scripts/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 rule provable_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:

RED   aprender-core-0.71.0 (lib test): 1 error(s) in the published tarball
        src/metrics/f32_bits_tests.rs:22:5: error: couldn't read `pkgs/aprender-core-0.71.0/src/metrics/../../../../scripts/setfit_fixtures/claims_stats/ece_top_label_cases.json`: No such file or directory (os error 2)
FAIL  a published tarball does not compile its own tests (cargo rc 101)

GREEN on 5e9574f, rc 0:

PASS  all 73 published tarball(s) compile their tests (cargo build --tests)

GREEN on 9939c9c (the skip-count follow-up), rc 0:

PASS  all 73 published tarball(s) compile their tests (cargo build --tests)
SKIP SITES   aprender-core-0.71.0              13 run-time *_or_skip( call site(s) in shipped code

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 --check is 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

…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 noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-contracts tree.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-contracts is 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's unwrap_or_default() only matters out of tree.
  • One check is still open: the body's GREEN package_tarball_build.sh line 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 noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 through provable_contracts::workspace_file_or_skip!, the same helper format/ship_00*.rs and provenance_tests.rs already use (#4130/#4175). provable-contracts is a versioned dev-dependency of aprender-core, so it survives cargo 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_snapshot uses unwrap_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 noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DIR is still aprender-core.
  • test_support is #[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 noahgift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=5179 head=9939c9c4fce91aa64557b3f8bf097b6f305a3f52 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

@noahgift
noahgift added this pull request to the merge queue Oct 12, 2026
Merged via the queue into main with commit 28e42fd Oct 12, 2026
17 checks passed
@noahgift
noahgift deleted the fix/5171-f32-bits-fixture-runtime branch October 12, 2026 05:03
@noahgift noahgift mentioned this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant