darner-gpu: pin the --only-buffers predicates #587

Open
qnjk wants to merge 1 commit from qnjk/Darner:replay-chosen-test into Main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: nothing. This is a tests-only change (no production line is edited).

  • What it pins: chosen (crates/darner-gpu/src/replay/play.rs, around :286) decides which buffers --buffers vram|sysmem moves to the PC's memory, and so which bytes of a replay differ from the recorded run: a filter that is wrong measures a frame that is not the recorded one. Its language is documented in docs/replay.md:72 (name=, min=, max=, seen=, id=a..b, or ! and one of them) and the function had no test at all, though three of its rules are easy to break by accident: a filter with no = is a name filter, ! negates only its own filter while the filters stay ANDed, and id=a..b is a half-open Rust range rather than the inclusive one the .. notation suggests.

  • This change adds one test that pins those rules for the records a capture carries, including an empty filter and a filter that names nothing.

How it was tested

  • Tested revision: dbc16d1 (one commit on c8258f9).
  • Commands and results:
    • cargo test --locked -p darner-gpu --lib -- replay — passes (the new test among them).
    • cargo clippy --locked -p darner-gpu --all-targets -- -D warnings passes.
    • Fail-before: the function is correct, so there is no old behaviour to break; the assertions' teeth were shown by mutating the function (negation, the half-open range, and the no-= name rule) one at a time and watching the corresponding case fail.
  • Changes a default: no. Tests only.
  • A/B result: not applicable — tests-only change.
  • Gates run on that revision:
    • Gate 1, cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
    • Gate 2, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.
    • Gate 3, cargo test --workspace --locked: not run to completion here; darner-gpu has the pre-existing order-dependent failures and the #224 deadlock, which is why the whole-workspace run is not green on this machine. The crate's replay tests pass.
  • Gameplay, when relevant: not applicable — tests-only change.
  • Shader wave sizes tested, when relevant: not applicable.
  • Hardware dependence: none.
  • Coverage gaps: the test builds records by hand rather than from a real capture file; the seen= and min=/max= numeric bounds are pinned at their edges only.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • Not applicable: tests-only change, stated at the top.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md. (cargo xtask policy: 576 files ok.)
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #45 and #46 change crates/darner-gpu/src/replay/play.rs too; this change only adds a test block. No open or closed issue mentions chosen or --only-buffers.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: nothing. This is a **tests-only** change (no production line is edited). - What it pins: `chosen` (`crates/darner-gpu/src/replay/play.rs`, around `:286`) decides which buffers `--buffers vram|sysmem` moves to the PC's memory, and so which bytes of a replay differ from the recorded run: a filter that is wrong measures a frame that is not the recorded one. Its language is documented in `docs/replay.md:72` (`name=`, `min=`, `max=`, `seen=`, `id=a..b`, or `!` and one of them) and the function had no test at all, though three of its rules are easy to break by accident: a filter with no `=` is a name filter, `!` negates only its own filter while the filters stay ANDed, and `id=a..b` is a half-open Rust range rather than the inclusive one the `..` notation suggests. - This change adds one test that pins those rules for the records a capture carries, including an empty filter and a filter that names nothing. ## How it was tested - Tested revision: `dbc16d1` (one commit on `c8258f9`). - Commands and results: - `cargo test --locked -p darner-gpu --lib -- replay` — passes (the new test among them). - `cargo clippy --locked -p darner-gpu --all-targets -- -D warnings` passes. - Fail-before: the function is correct, so there is no old behaviour to break; the assertions' teeth were shown by mutating the function (negation, the half-open range, and the no-`=` name rule) one at a time and watching the corresponding case fail. - Changes a default: no. Tests only. - A/B result: not applicable — tests-only change. - Gates run on that revision: - Gate 1, `cargo clippy --workspace --all-targets --locked -- -D warnings`: passes. - Gate 2, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passes. - Gate 3, `cargo test --workspace --locked`: not run to completion here; `darner-gpu` has the pre-existing order-dependent failures and the #224 deadlock, which is why the whole-workspace run is not green on this machine. The crate's `replay` tests pass. - Gameplay, when relevant: not applicable — tests-only change. - Shader wave sizes tested, when relevant: not applicable. - Hardware dependence: none. - Coverage gaps: the test builds records by hand rather than from a real capture file; the `seen=` and `min=`/`max=` numeric bounds are pinned at their edges only. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - Not applicable: tests-only change, stated at the top. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. (`cargo xtask policy`: 576 files ok.) - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #45 and #46 change `crates/darner-gpu/src/replay/play.rs` too; this change only adds a test block. No open or closed issue mentions `chosen` or `--only-buffers`. - Replaces or overlaps: none found
`chosen` decides which buffers `--buffers vram|sysmem` moves to the PC's
memory, and so which bytes of a replay differ from the recorded run: a filter
that is wrong measures a frame that is not the recorded one. Its language is
documented in docs/replay.md:72 (`name=`, `min=`, `max=`, `seen=`, `id=a..b`,
or `!` and one of them) and the function had no test at all, though three of
its rules are easy to break by accident: a filter with no `=` is a name
filter, `!` negates only its own filter while the filters stay ANDed, and
`id=a..b` is a half-open Rust range rather than the inclusive one the `..`
notation suggests.

Pin which records pass and which do not. No filter means every buffer; a
name filter is a substring of the name, so one that names nothing passes
nothing and the empty one passes everything; `min`/`max` include their own
byte count; `id=3..7` holds 3 but not 7 and `id=3` holds nothing; `seen=` is
the heap the CPU saw, case-insensitively, and a placed buffer has none. The
test is in its own module so it does not stand in the way of the other replay
tests.
TrustNo1 changed title from [pr-tests] darner-gpu: pin the --only-buffers predicates to darner-gpu: pin the --only-buffers predicates 2026-12-06 03:26:49 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'replay-chosen-test:qnjk-replay-chosen-test'
git switch 'qnjk-replay-chosen-test'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'qnjk-replay-chosen-test'
git switch 'qnjk-replay-chosen-test'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'qnjk-replay-chosen-test'
git switch 'qnjk-replay-chosen-test'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'qnjk-replay-chosen-test'
git switch 'Main'
git merge --squash 'qnjk-replay-chosen-test'
git switch 'Main'
git merge --ff-only 'qnjk-replay-chosen-test'
git switch 'Main'
git merge 'qnjk-replay-chosen-test'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!587
No description provided.