Skip to content

test(core): keep proptest's reject budgets per case and build non-whitespace names - #330

Merged
aRustyDev merged 1 commit into
mainfrom
fix/proptest-reject-budgets
Nov 19, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
fix/proptest-reject-budgets

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

What

The first of the two steps you chose for G-48 (the deep profile, which #329 records): fix the two reject-heavy properties first, then the nightly advisory job.

At PROPTEST_CASES=4096 two thrust-core properties fail with proptest's "Too many rejects", though nothing about them is wrong. I reproduced it on unchanged code before touching anything:

  • prop_accepted_blob_names_stay_inside_their_scope: "Too many global rejects" (1,024)
  • prop_names_longer_than_255_chars_are_rejected: "Too many local rejects" (65,536)

proptest's limits are absolute, sized for its 256 cases (4 and 256 a case); proptest_config scaled the cases and left the limits. A test that discards a fixed share of its inputs fits at 256 and gives up at 4096. The profile's own comment says "4096 or more", so a limit that only fits one count is the defect.

The change (two files, crates/core/usecases/src)

  1. non_whitespace builds its strings instead of filtering them, as the rust-test-logic skill says to ("generate valid values by construction"). It filtered every character with prop_filter and rejected about 7.7% of them (about 22 a case). A whitespace draw now becomes x.
  2. proptest_config keeps proptest's reject budgets per case (config_for): at least proptest's own limits, and 4 global and 256 local rejects a case. At 256 cases or fewer the limits are exactly proptest's, so the default loop is unchanged.

Why the blob-name property keeps its prop_assume!, and I did not build valid names for it: the validator is its oracle. The names it throws out are the point (a bare . was once accepted, and this property found it, which is regression_single_dot), so generating only valid names would blind it. I also did not turn the discard into an early return: that counts the discards as passes and cuts the effective checks by about 30% at the default 256 cases, which would weaken the test. Scaling the budget keeps every check.

Controls (each can fail, each did)

Control Result
unchanged code, PROPTEST_CASES=4096 both properties fail ("Too many local rejects: 65536", "Too many global rejects: 1024")
after, the whole deep profile of thrust-core at 4096 56 tests passed, exit 0
after, the three name properties at 16,384 3 passed
the prop_filter put back visible_names_are_built_not_filtered fails: "the strategy rejected a draw: Too many local rejects"
config_for not scaling 7 of 13 config tests fail (from 257 cases, where 4 x 257 passes 1,024), and the real property aborts at 4096 again

New tests: visible_names_are_built_not_filtered (the strategy under a runner that allows no rejects at all), config_for_keeps_the_reject_budgets_per_case (twelve case counts, 0 to u32::MAX) and config_for_at_the_default_cases_is_proptests_own. Also: cargo fmt --check and clippy -D warnings clean, and all 1,649 thrust-core tests pass at the default case count.

Not changed, and one thing I did not look into

No closing keyword: part of a plan, not an issue.

🤖 Generated with Claude Code

…tespace names

The deep profile (PROPTEST_CASES=4096), measured on a runner for stage 3 of the Test phase, fails two thrust-core properties with proptest's "Too many rejects", though nothing about them is wrong: prop_accepted_blob_names_stay_inside_their_scope ("Too many global rejects", 1,024) and prop_names_longer_than_255_chars_are_rejected ("Too many local rejects", 65,536). proptest's limits are absolute, sized for its 256 cases (4 and 256 a case), while proptest_config scaled the cases and left the limits, so a test that discards a fixed share of its inputs fits at 256 and gives up at 4096. Reproduced on unchanged code before the fix.

Two changes, each held by a test that can fail.

non_whitespace filtered every character with prop_filter, which rejected about 7.7% of them (about 22 a case). It now builds the string: a whitespace draw becomes `x`, so it never rejects, as the rust-test-logic skill says to do. visible_names_are_built_not_filtered runs the strategy under a runner that allows no rejects at all, and a strategy that filters fails it on its first discarded draw.

The blob-name property keeps its prop_assume!: the validator is its oracle, the names it throws out are the point (a bare "." was once accepted and found this way), and an early return instead would count the discards as passes and cut the effective checks by about 30% at the default 256 cases. proptest_config now keeps the budgets per case through config_for: at least proptest's own limits, and 4 global and 256 local rejects a case, so at 256 cases or fewer the limits are proptest's own and the default loop is unchanged. config_for_keeps_the_reject_budgets_per_case checks twelve case counts from 0 to u32::MAX, and config_for_at_the_default_cases_is_proptests_own pins the default.

Other copies of proptest_config (14 crates, copied from the skill's template by design) are not changed: no property of theirs failed in the deep run.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aRustyDev
aRustyDev temporarily deployed to preview-control-plane November 19, 2026 04:35 — with GitHub Actions Inactive
@aRustyDev
aRustyDev merged commit 7f5d33e into main Nov 19, 2026
45 checks passed
@aRustyDev
aRustyDev deleted the fix/proptest-reject-budgets branch November 19, 2026 05:11
aRustyDev added a commit that referenced this pull request Nov 19, 2026
One conflict, in docs/src/testing/status.md: #330 added a G-48 row (the `deep` nextest profile) while this branch added a G-48 row for the
deep health check. Main's row keeps G-48, since it landed first and other files already cite it (`test_support.rs`, the ci-workflows plan).
This branch's row is now G-49, and the one place this branch cites it (the contract test's doc comment) says G-49.

Nothing else conflicted. Checked on the merged tree: fmt, 2456 tests of thrust-api, thrust-core and the two adapters, check-deps,
check-cargo-lock, check-contract-counts and `cargo metadata --locked`.

Refs: #42
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev added a commit that referenced this pull request Nov 19, 2026
… and the numbers after the merge (#335)

G-48 (the deep profile) is done as the owner decided on 2026-11-19: the two reject-heavy tests are fixed (#330) and the profile runs nightly as deep.yml (#331), not gated and without the oracle_ tests, red only for issue #114 in the two runs of the job itself. The phase document's stage table, findings and decisions say so, and running.md's runbook no longer says deep fails today.

The numbers after the merge of #329, from three dispatches of the hermetic job on main once it had built the new cache (402 MiB against 651 MiB): the two runs that restored the cache took 126 s and 130 s (the nextest step 74 s and 72 s), against 153 to 172 s and 95 to 98 s before, which is the probe's result within a few seconds. The third restored no cache and built from scratch (129 s for the step, 200 s for the job); the cause is not known.

Co-authored-by: Claude Sonnet 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
preview-control-plane — 9f199f96 Deployed Nov 19, 2026 by aRustyDev via reconcile #225
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