perf(miri): trim heavy tests so the miri job finishes in reasonable time#1537
Merged
Conversation
71d8f41 to
24da819
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Three independent miri-only test trims to keep CI miri runtime in budget. The collapse fuzz test shrinks its generator under miri, the stateless NAT full-config test skips the tracing subscriber and noisy debug print, and miri's weak-memory failure injection rate is dropped from 0.15 to 0.05. All changes are no-ops outside cfg(miri).
Changes:
- Gate down
test_bolero_collapse_prefix_listsgenerator parameters under miri viacfg_select!. - In
test_full_config, skiptraced_testsubscriber andprintln!dump under miri; drop a per-callvec!allocation incheck_packet. - Lower
weak_failure_ratefrom 0.15 to 0.05 inmiri.just.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| config/src/utils/collapse.rs | Use cfg_select! to use smaller generator bounds when running under miri. |
| nat/src/stateless/test.rs | Skip traced_test and debug println! under miri; replace vec![packet] with [packet]. |
| miri.just | Reduce weak_failure_rate from 0.15 to 0.05. |
Three independent miri-only adjustments collected for the per-CI-run budget. All are no-ops outside `cfg(miri)`: * `config/src/utils/collapse.rs`: the bolero generator for `test_bolero_collapse_prefix_lists` shrinks from (prefix_max=100, exclude_max=100, addr_count=1000) to (10, 10, 100) under miri. Miri's borrow-stack cost on prefix-trie traversal is ~100-1000x; the algorithmic coverage is the same with the smaller shape. * `nat/src/stateless/test.rs`: `test_full_config` was dominated by `#[traced_test]` subscriber dispatch (formatting, TLS atomics, layer walk, capture mutex) on per-packet `debug!` calls -- hundreds of events per run, each disproportionately expensive under miri. Skip the subscriber install under miri, gate out the `println!` debug dump, and use `[packet]` rather than `vec![packet]` to drop one per-call allocation. * `miri.just`: weak_failure_rate 0.15 -> 0.05. The 0.15 value was inflating test time excessively for some tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Daniel Noland <daniel@githedgehog.com>
24da819 to
b726717
Compare
Fredi-raspall
approved these changes
May 15, 2026
Contributor
Fredi-raspall
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three independent miri-only adjustments collected for the per-CI-run budget. All are no-ops outside
cfg(miri):config/src/utils/collapse.rs: the bolero generator fortest_bolero_collapse_prefix_listsshrinks from (prefix_max=100, exclude_max=100, addr_count=1000) to (10, 10, 100) under miri. Miri's borrow-stack cost on prefix-trie traversal is ~100-1000x; the algorithmic coverage is largely the same with the smaller shape.nat/src/stateless/test.rs:test_full_configwas dominated by#[traced_test]subscriber dispatch (formatting, TLS atomics, layer walk, capture mutex) on per-packetdebug!calls; hundreds of events per run, each disproportionately expensive under miri. Skip the subscriber install under miri, gate out theprintln!debug dump, and use[packet]rather thanvec![packet]to drop one per-call allocation.miri.just: weak_failure_rate 0.15 -> 0.05. The 0.15 value was inflating miri's weak-memory failure injection beyond what the protocol invariants are tuned for; 0.05 still exercises the path and gives shuttle headroom for other interleavings. We should still (sometimes) run with higher weak failure rates, but no need to burn endless resources on it.