Repository navigation
test(tla): weekly bounds-escalated corpus replay - #1694
Merged
Merged
Conversation
The committed corpora cover each spec's small CI bounds exhaustively; this adds scheduled depth beyond them without committing large files: - scripts/tla-escalated-replay.py: regenerates every corpus at larger bounds (per-spec ESCALATED table respecting derive/replay assumptions — STRICTCorrect keeps MaxUnits=1 and MaxCurrency=2) into a scratch dir. A drift guard fails fast if a committed corpus lacks an escalation entry, so a new spec cannot silently skip escalated coverage (the replay's graceful corpus-skip would otherwise turn the gap into a vacuous green). - tla_behavior_replay.rs: RUSTLEDGER_TLA_BEHAVIORS_DIR points the replay at an alternative corpus directory. The corpus-completeness guard is now the exact invariant (behaviors == the corpus's declared count, non-zero) — the old transitions*90% heuristic false-positived at escalated bounds, where canonical dedup legitimately collapses more STRICT transitions. - .github/workflows/tla-escalated.yml: weekly (Sun 04:30 UTC) + manual dispatch — generate escalated corpora, replay, summarize coverage. Proven locally end to end: 903,210 escalated behaviors across all 7 specs replay green in ~12s (AVERAGE: 221,613 value-checked behaviors at 63k states; FIFO/LIFO/HIFO: 221k each), and the committed corpora stay green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
📊 Benchmark Results
vs main branch (2026-07-02)
What do these numbers mean?
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a scheduled “bounds-escalated” TLA+ behavior-corpus regeneration + replay path so the repo can regularly validate conformance beyond the small committed CI corpora, without committing the large escalated JSON files.
Changes:
- Introduces
scripts/tla-escalated-replay.pyto regenerate all committed behavior corpora at per-spec escalated bounds into a scratch directory, with a drift guard to ensure coverage isn’t silently skipped. - Updates
tla_behavior_replay.rsto supportRUSTLEDGER_TLA_BEHAVIORS_DIRoverrides and to tighten the corpus completeness check to an exactbehaviors == declaredinvariant. - Adds a weekly + manual GitHub Actions workflow to run the escalated regeneration + replay and publish per-spec coverage in the job summary.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| scripts/tla-escalated-replay.py | New script to regenerate escalated corpora (without committing them) and enforce an escalation-entry drift guard. |
| crates/rustledger-core/tests/tla_behavior_replay.rs | Adds corpus directory override and changes the completeness invariant to match declared behavior counts. |
| .github/workflows/tla-escalated.yml | New weekly workflow to generate escalated corpora, replay them, and emit coverage summary output. |
Comments suppressed due to low confidence (1)
crates/rustledger-core/tests/tla_behavior_replay.rs:53
- When
RUSTLEDGER_TLA_BEHAVIORS_DIRis set but the corpus file is missing (wrong dir, empty env var, partial generation), the test currently does a graceful skip and can become vacuously green. Treat an explicit override as required input: fail if the file isn’t found; keep the graceful skip only for the default committed-corpus path (published-crate builds).
let path = match std::env::var("RUSTLEDGER_TLA_BEHAVIORS_DIR") {
Ok(dir) => std::path::PathBuf::from(dir).join(format!("{spec}.json")),
Err(_) => std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.join(format!("../../spec/tla/behaviors/{spec}.json")),
};
// Graceful skip when spec/ isn't packaged (published-crate builds strip
// it, and the Nix flake's source filter does too — the #1659 lesson).
let Ok(raw) = std::fs::read_to_string(&path) else {
eprintln!(
"skipping: {} not present (published-crate build)",
path.display()
);
return None;
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
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.
FV backlog: scheduled depth beyond the committed corpora's small CI bounds — 903,210 behaviors across all 7 specs replay green in ~12s at escalated bounds, without committing the large files.
Pieces
scripts/tla-escalated-replay.py— regenerates every corpus at a per-spec ESCALATED bounds table (respecting derive/replay assumptions: STRICT keepsMaxUnits=1/MaxCurrency=2). Drift guard: a committed corpus without an escalation entry fails fast — otherwise the replay's graceful corpus-skip would turn the gap into a vacuous green (hazard found while building this, by watching exactly that happen).tla_behavior_replay.rs—RUSTLEDGER_TLA_BEHAVIORS_DIRoverride; the corpus-completeness guard becomes the exact invariant (behaviors == declared count) after the oldtransitions×90%heuristic false-positived at scale (STRICT's canonical dedup legitimately collapses more transitions at larger bounds)..github/workflows/tla-escalated.yml— weekly (Sun 04:30 UTC) +workflow_dispatch, with per-spec coverage in the job summary.Verified locally end to end with real TLC; committed corpora stay green; clippy
-D warnings+ fmt clean.🤖 Generated with Claude Code