Skip to content

feat(walker): cooperative cancellation, progress reporting, property tests - #195

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/cancel-progress-proptest
Aug 30, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/cancel-progress-proptest

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

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

  • 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: clean
  • 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).

Note

Medium Risk
New public Error::Cancelled and 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 public Error::Cancelled when a caller aborts mid-scan (no partial results).

Existing _*with_limits entry points are unchanged in signature and behavior; new _*with_control hooks run cancellation checks on a 1 MiB cadence during candidate scan, every 256 candidates during decode, and around each partition stream. scan_partitions_with_control reports per-stream progress.

rvt-elements gains --progress, printing stage lines to stderr. CI adds tests/control_cancellation.rs (tier-1 fixture) and tests/proptest_parsers.rs (never-panic byte parsers + JSON round-trips via proptest).

Reviewed by Cursor Bugbot for commit 958b2d5. Configure here.

…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.
@DrunkOnJava
DrunkOnJava merged commit 01f8007 into main Aug 30, 2026
@DrunkOnJava
DrunkOnJava deleted the feat/cancel-progress-proptest branch August 30, 2026 09:01
@cursor

cursor Bot commented Aug 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

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