Bench: remote block, per-frame record and in-game route on Merge, for the city bench kit #665

Open
cafe wants to merge 2 commits from cafe/merge-bench-kit into post-merge AGit
Contributor

Contributor role (optional)

  • Fluxer ID: 1577752157942198273 (Cafe#9189)

What it changes

  • The problem on Merge: the city camera bench kit (gta-bench-kit) cannot drive a run. There is no remote block (scripted pads, memory pins, route tags) and no per-frame record, so the camera never flies and no frame data is written.
  • For the Merge branch, as asked on Fluxer. Everything is off by default: with the switches unset, each hook is one OnceLock read and a branch.

Commit 1, Bench: remote block (DARNER_REMOTE) and per-frame record (DARNER_BENCH_CSV):

  • remote.rs, DARNER_REMOTE=<name>: the kit's named 0x2000-byte shared block, the same layout as main's remote.rs (version 3, magic VRM1), so the kit's tools work unchanged. Pins are written from inside the process with the guarded copy, as on main.
  • bench.rs, DARNER_BENCH_CSV=<file>: one CSV row per title Present, written on its own thread; refuses a file that exists. The column names are main's, so bench-report.py reads it as is: a subset of main's columns (the ones this base gives cheaply) plus pipe_making.
  • queue.rs: the Present calls both. gameinput.rs: the block's pads replace the host's per slot at each poll, before the hold at the menu; mouse and keyboard still merge on top.

Commit 2, Bench: in-game route (DARNER_BENCH_ROUTE), remote block version 4:

  • The kit's layer/darner-route.patch (route.rs), ported to Merge. With DARNER_BENCH_ROUTE=<route file> (plus DARNER_BENCH_ROUTE_UP, DARNER_BENCH_ROUTE_CAMERA=1, DARNER_BENCH_ROUTE_CHAR_Z), the layer flies the route itself when the kit raises route_go, so nothing outside the game reads or writes its memory during the flight (the kit's bench.ps1 -InGame / -InGamePlayer, route-go.py).
  • Changes from the patch:
    • The block says version 4 only when the route switch is set, and 3 otherwise, so the kit's other tools (vremote.py accepts 1-3) keep working.
    • Reads and writes go through the remote's guarded copy, inside the remote's memory window.
    • The route file is read once; a bad file leaves route_state at 6 instead of a warning every poll.
  • README: the switches, under a "For benchmarks" table.

How it was tested

  • Tested revision: these two commits plus one local measuring switch that is not in this PR (an unpaced frame clock, the same for both runs). Built on 3c32a935d; merges clean onto 28a9b4259.
  • Default: no change (every switch unset).
  • City flight, the kit's cam-city route (172 s) and save, card frame times by PresentMon over the flight:
Run How the camera flew fps median ms p99 ms card ms Result
1 the kit's outside flight (commit 1) 28.96 32.3 53.0 32.0 whole route, 22,959 record rows, 5,136 tagged
2 in-game route, -InGame (commit 2) 28.89 33.7 53.2 33.6 route done, body present 100 %, no outside memory access
  • On this base the in-game route gives no speed of its own on my card (one run each), unlike on main, where the outside reads cost a lot. That fits Merge not using the write watch.
  • Card and profile: RTX 2080 Ti, Windows 10 22H2, Series S profile, the title's 1080p output, DLSS 0.5 (preset M), hardware RT. The NVIDIA profile has the shader heap at 1 GB (0x001ABC0F).
  • Gates:
    • cargo build --locked --release -p darner: clean.
    • cargo clippy --locked --release -p darner: 69 warnings, the same list as the base; none in the changed files.
    • cargo test --locked --release -p darner-gpu --lib -- remote:: bench:: route::: 13 passed.
  • Kit side, for Merge: the launcher must pass DARNER_ names (VICTORY_REMOTE, VICTORY_BENCH_CSV, VICTORY_BENCH_ROUTE* → DARNER_…).
  • Not tested: -InGamePlayer (game camera), Linux/Proton, other cards, real pads while the block is open. No picture check is needed: nothing changes on screen unless a switch is set.

Checklist

  • One change (the kit's hooks), based on Merge.
  • Off by default; no game files (docs/asset-policy.md).
  • Depends on: none.

Checked for overlap

  • Searched open and recent closed PRs and issues for remote, bench, kit, csv, route and Merge. No PR targets Merge.
  • Related, on main: #596 (another outdoor harness, WIP) and #553 (flushes main's CSV rows at exit). Neither touches Merge.
## Contributor role (optional) - Fluxer ID: `1577752157942198273` (Cafe#9189) ## What it changes - The problem on Merge: the city camera bench kit (`gta-bench-kit`) cannot drive a run. There is no remote block (scripted pads, memory pins, route tags) and no per-frame record, so the camera never flies and no frame data is written. - For the **Merge** branch, as asked on Fluxer. Everything is **off by default**: with the switches unset, each hook is one `OnceLock` read and a branch. Commit 1, `Bench: remote block (DARNER_REMOTE) and per-frame record (DARNER_BENCH_CSV)`: - `remote.rs`, `DARNER_REMOTE=<name>`: the kit's named 0x2000-byte shared block, the same layout as main's `remote.rs` (version 3, magic `VRM1`), so the kit's tools work unchanged. Pins are written from inside the process with the guarded copy, as on main. - `bench.rs`, `DARNER_BENCH_CSV=<file>`: one CSV row per title Present, written on its own thread; refuses a file that exists. The column names are main's, so `bench-report.py` reads it as is: a subset of main's columns (the ones this base gives cheaply) plus `pipe_making`. - `queue.rs`: the Present calls both. `gameinput.rs`: the block's pads replace the host's per slot at each poll, before the hold at the menu; mouse and keyboard still merge on top. Commit 2, `Bench: in-game route (DARNER_BENCH_ROUTE), remote block version 4`: - The kit's `layer/darner-route.patch` (route.rs), ported to Merge. With `DARNER_BENCH_ROUTE=<route file>` (plus `DARNER_BENCH_ROUTE_UP`, `DARNER_BENCH_ROUTE_CAMERA=1`, `DARNER_BENCH_ROUTE_CHAR_Z`), the layer flies the route itself when the kit raises `route_go`, so nothing outside the game reads or writes its memory during the flight (the kit's `bench.ps1 -InGame` / `-InGamePlayer`, `route-go.py`). - Changes from the patch: - The block says version 4 only when the route switch is set, and 3 otherwise, so the kit's other tools (`vremote.py` accepts 1-3) keep working. - Reads and writes go through the remote's guarded copy, inside the remote's memory window. - The route file is read once; a bad file leaves `route_state` at 6 instead of a warning every poll. - README: the switches, under a "For benchmarks" table. ## How it was tested - Tested revision: these two commits plus one local measuring switch that is not in this PR (an unpaced frame clock, the same for both runs). Built on 3c32a935d; merges clean onto 28a9b4259. - Default: no change (every switch unset). - City flight, the kit's `cam-city` route (172 s) and save, card frame times by PresentMon over the flight: | Run | How the camera flew | fps | median ms | p99 ms | card ms | Result | |---|---|---|---|---|---|---| | 1 | the kit's outside flight (commit 1) | 28.96 | 32.3 | 53.0 | 32.0 | whole route, 22,959 record rows, 5,136 tagged | | 2 | in-game route, `-InGame` (commit 2) | 28.89 | 33.7 | 53.2 | 33.6 | route done, body present 100 %, no outside memory access | - On this base the in-game route gives no speed of its own on my card (one run each), unlike on main, where the outside reads cost a lot. That fits Merge not using the write watch. - Card and profile: RTX 2080 Ti, Windows 10 22H2, Series S profile, the title's 1080p output, DLSS 0.5 (preset M), hardware RT. The NVIDIA profile has the shader heap at 1 GB (0x001ABC0F). - Gates: - `cargo build --locked --release -p darner`: clean. - `cargo clippy --locked --release -p darner`: 69 warnings, the same list as the base; none in the changed files. - `cargo test --locked --release -p darner-gpu --lib -- remote:: bench:: route::`: 13 passed. - Kit side, for Merge: the launcher must pass `DARNER_` names (`VICTORY_REMOTE`, `VICTORY_BENCH_CSV`, `VICTORY_BENCH_ROUTE*` → `DARNER_…`). - Not tested: `-InGamePlayer` (game camera), Linux/Proton, other cards, real pads while the block is open. No picture check is needed: nothing changes on screen unless a switch is set. ## Checklist - [x] One change (the kit's hooks), based on `Merge`. - [x] Off by default; no game files (`docs/asset-policy.md`). - [x] Depends on: none. ## Checked for overlap - [x] Searched open and recent closed PRs and issues for remote, bench, kit, csv, route and Merge. No PR targets Merge. - Related, on main: #596 (another outdoor harness, WIP) and #553 (flushes main's CSV rows at exit). Neither touches Merge.
The two layer pieces TrustNo1's city camera bench kit (gta-bench-kit)
needs. Both are off by default: nothing happens unless their switch is set.

- remote.rs, DARNER_REMOTE=<name>: the kit's named 0x2000-byte shared
  block, layout version 3 unchanged (scripted pads, memory pins, route
  tags, frame and draw counters). Pins are stored by a plain in-process
  copy with a last-chance fault exit, so the write watch and the guards
  see them as title stores. No code patches, no screenshots.
- bench.rs, DARNER_BENCH_CSV=<file>: one CSV row per title Present
  (frame_ms, tags, draws, pipelines, shader cache, process memory),
  written on its own thread; refuses a file that exists.
- queue.rs: the Present calls both. gameinput.rs: the block's pads over
  the host's at each poll, before the hold at the menu.

- README: the two switches under "For benchmarks".
The bench kit's in-game route: the layer flies the player (or the dev
camera) along the kit's route itself, so no tool outside the process reads
or writes the title's memory during the flight. Reads from outside take the
process's address-space lock, which the write watch takes too; with them
the write watch cost several times what it costs in normal play.

- route.rs, DARNER_BENCH_ROUTE=<route file>: once the kit's tool raises
  route_go, holds the player at the first point until his body has been
  there 2 s, flies the route, holds the last point 7 s, then stops. The
  rows are read and written in the process by the remote block's guarded
  copy, so the guards and the write watch see title stores; pointers are
  checked against the window and with VirtualQuery. Each Present of the
  flight gets the route's tag record for the benchmark record.
  DARNER_BENCH_ROUTE_UP (default 50 m), DARNER_BENCH_ROUTE_CAMERA=1 (the
  dev camera flies, the player is held DARNER_BENCH_ROUTE_CHAR_Z metres
  up, default 90).
- remote.rs: layout version 4, the kit's: route_state (u32 at 0x07C,
  layer) and route_go (u32 at 0x604, tool), in words version 3 left free.
  The block says 4 only with DARNER_BENCH_ROUTE set, else 3 as before, so
  the kit's version-3 tools keep working. A route step at each pad poll
  and Present after the pins. A route_go left from an earlier run does not
  start it.
- darner-hle runtime.rs: the title's image base is passed to the block.
- README: the four switches under "For benchmarks".

Off by default: without DARNER_REMOTE nothing new runs; with it and no
DARNER_BENCH_ROUTE each step is one branch.
TrustNo1 changed title from [pr-diagnostics] Bench: remote block, per-frame record and in-game route on Merge, for the city bench kit to Bench: remote block, per-frame record and in-game route on Merge, for the city bench kit 2026-12-06 03:25:22 +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 origin '+refs/pull/665/head:cafe/merge-bench-kit'
git switch 'cafe/merge-bench-kit'

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 'post-merge'
git merge --no-ff 'cafe/merge-bench-kit'
git switch 'cafe/merge-bench-kit'
git rebase 'post-merge'
git switch 'post-merge'
git merge --ff-only 'cafe/merge-bench-kit'
git switch 'cafe/merge-bench-kit'
git rebase 'post-merge'
git switch 'post-merge'
git merge --no-ff 'cafe/merge-bench-kit'
git switch 'post-merge'
git merge --squash 'cafe/merge-bench-kit'
git switch 'post-merge'
git merge --ff-only 'cafe/merge-bench-kit'
git switch 'post-merge'
git merge 'cafe/merge-bench-kit'
git push origin 'post-merge'
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!665
No description provided.