Repository navigation
feat(walker): cooperative cancellation, progress reporting, property tests - #195
Merged
Merged
Conversation
…tests Adds rvt::control — CancelToken (shared atomic flag), WalkerControl (optional token + optional progress callback), Stage/ProgressEvent — and a new Error::Cancelled variant. New additive entry points take a &WalkerControl beside the existing *_with_limits ones, which now delegate with a no-op control: walker::scan_candidates_with_control, walker::iter_elements_with_control, partition_scanner:: scan_partitions_with_control. The token is checked every 1 MiB of scanned Global/Latest bytes, every 256 decoded candidates, before each partition stream, and once after each loop, so cancelling from inside the progress callback is honoured; nothing partial is yielded on cancel. rvt-elements gains --progress (stage done/total on stderr). tests/control_cancellation.rs runs on the tier-1 fixture: pre-cancelled token, stage order + monotone progress + done == total, cancel from the callback, partition scan. tests/proptest_parsers.rs (proptest, 96 cases each) asserts never-panic / in-bounds behaviour for page-checksum strip, gzip probes and inflate, Formats/Latest integrity, ElemTable records, parse_schema, partition buffer scan, and JSON round-trips for the ES / fixture research record types. Unified report §20.13 / §22.2, robustness lane; IFC export does not take a control yet.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_eb4aa70c-cd2d-40e1-baac-668c34dc8038) |
1 of 2 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Aug 30, 2026
…today (#196) ## Summary Makes the release-path viewer smoke run the compiled-WASM import audit (it skipped for lack of `wasm-objdump`), and brings the hand-curated `[Unreleased]` changelog up to date with today's merged changes. ## Changes - .github/workflows/publish.yml — `apt-get install wabt` before the viewer build, mirroring deploy-viewer.yml - CHANGELOG.md — Added / Changed entries for #182, #183, #185, #189, #190, #191/#192, #193, #195 ## Testing - [x] YAML + actionlint clean - [ ] Fourth `workflow_dispatch` dry-run after merge must show the `wasm-no-network-imports` spec as ✓ instead of skipped
DrunkOnJava
added a commit
that referenced
this pull request
Aug 31, 2026
…tests (#195) ## Summary Robustness lane from the unified report (§20.13 / §22.2): a `control` module with `CancelToken` + `WalkerControl` (optional token, optional progress callback), `Error::Cancelled`, additive `_with_control` entry points for the candidate scan, element iteration and partition scan, `rvt-elements --progress`, and a stable-Rust property-test suite over the public byte parsers and research record types. ## Motivation Project files keep the walker busy for a long time with no way to stop it or see it move. Both hooks are opt-in; every existing `_with_limits` entry point keeps its signature and delegates with a no-op control, so output is unchanged (the tests assert element/candidate counts match the plain entry points). ## Changes - src/control.rs (new), src/error.rs (`Cancelled`), src/lib.rs - src/walker.rs — `scan_candidates_with_control`, `iter_elements_with_control` (checks every 1 MiB / 256 candidates / after each loop) - src/partition_scanner.rs — `scan_partitions_with_control` (per stream) - src/bin/rvt_elements.rs — `--progress` - tests/control_cancellation.rs, tests/proptest_parsers.rs; Cargo.toml — `proptest` dev-dependency ## Testing - [x] `cargo test --workspace --all-targets --all-features`: 1,095 passed (was 1,074) - [x] `cargo clippy --workspace --all-targets --all-features -- -D warnings`, `cargo fmt --check`, rustdoc `-D warnings`: clean - [x] `rvt-elements corpus/tier1/architectural-2024/architectural-2024.rvt --counts --progress` prints schema-parse → candidate-scan → element-decode → partition-scan - Not in scope: threading the control through IFC export (`build_export_diagnostics_*` still calls the plain walker); noted in the module docs ## Audit-honesty checklist - No capability claims change; `Error::Cancelled` is a new public enum variant (pre-1.0, called out here).
DrunkOnJava
added a commit
that referenced
this pull request
Aug 31, 2026
…today (#196) ## Summary Makes the release-path viewer smoke run the compiled-WASM import audit (it skipped for lack of `wasm-objdump`), and brings the hand-curated `[Unreleased]` changelog up to date with today's merged changes. ## Changes - .github/workflows/publish.yml — `apt-get install wabt` before the viewer build, mirroring deploy-viewer.yml - CHANGELOG.md — Added / Changed entries for #182, #183, #185, #189, #190, #191/#192, #193, #195 ## Testing - [x] YAML + actionlint clean - [ ] Fourth `workflow_dispatch` dry-run after merge must show the `wasm-no-network-imports` spec as ✓ instead of skipped
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.
Summary
Robustness lane from the unified report (§20.13 / §22.2): a
controlmodule withCancelToken+WalkerControl(optional token, optional progress callback),Error::Cancelled, additive_with_controlentry points for the candidate scan, element iteration and partition scan,rvt-elements --progress, and a stable-Rust property-test suite over the public byte parsers and research record types.Motivation
Project files keep the walker busy for a long time with no way to stop it or see it move. Both hooks are opt-in; every existing
_with_limitsentry point keeps its signature and delegates with a no-op control, so output is unchanged (the tests assert element/candidate counts match the plain entry points).Changes
Cancelled), src/lib.rsscan_candidates_with_control,iter_elements_with_control(checks every 1 MiB / 256 candidates / after each loop)scan_partitions_with_control(per stream)--progressproptestdev-dependencyTesting
cargo test --workspace --all-targets --all-features: 1,095 passed (was 1,074)cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo fmt --check, rustdoc-D warnings: cleanrvt-elements corpus/tier1/architectural-2024/architectural-2024.rvt --counts --progressprints schema-parse → candidate-scan → element-decode → partition-scanbuild_export_diagnostics_*still calls the plain walker); noted in the module docsAudit-honesty checklist
Error::Cancelledis a new public enum variant (pre-1.0, called out here).Note
Medium Risk
New public
Error::Cancelledand walker control paths touch core scan loops, though tests assert unchanged output when control is default; cancellation semantics must stay correct for UI/batch callers.Overview
Adds an opt-in control layer for long-running scans:
CancelToken,WalkerControl, staged progress events, and a new publicError::Cancelledwhen a caller aborts mid-scan (no partial results).Existing
_*with_limitsentry points are unchanged in signature and behavior; new_*with_controlhooks run cancellation checks on a 1 MiB cadence during candidate scan, every 256 candidates during decode, and around each partition stream.scan_partitions_with_controlreports per-stream progress.rvt-elementsgains--progress, printing stage lines to stderr. CI addstests/control_cancellation.rs(tier-1 fixture) andtests/proptest_parsers.rs(never-panic byte parsers + JSON round-trips viaproptest).Reviewed by Cursor Bugbot for commit 958b2d5. Configure here.