Write watch: the refreshes' checks read the journal without its lock #527

Open
BrenoMazini wants to merge 3 commits from upstream-pr/527 into main
BrenoMazini commented 2026-12-03 02:04:52 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-03T02:04:52Z.


Follow-up to #472, as @GValdezN suggested there. #472 lets unchanged copies skip the JOURNAL lock with a hashed bitmap. This PR makes all of the refreshes' journal reads lock-free: writes_into, writes_since and both nothing-new checks.

What

Every refresh check took the write-watch journal's RwLock, and that lock was heavily contended:

  • per frame, ~900 writes_into calls and ~8,000 checks of copies known to copy nothing;
  • those 8,000 checks ran in batches of up to 256 under one read lock.

A thread noting what the kernel or the guards found waited ~70 µs for the readers to leave. Windows' SRW lock blocks new readers while a writer waits, so every reader then queued behind that writer: ~7 µs for each writes_into answer.

This PR adds VICTORY_JOURNAL_MIRROR: on by default, and 0 restores the old behaviour.

  • Lock-free page table. The pages' last askings are also kept in a table read without a lock:

    • one AtomicU64 per 64 KiB page;
    • grouped in 256 MiB leaves, each created when a page in it is first noted;
    • beside each group of 64 pages, the group's latest asking, so checks skip groups that are old or were never written.

    Notes go in through the journal's write guard (JournalMut::note).

  • Published asking ahead. The asking ahead (its ranges, its number, whether it stands) is published as an Arc whenever it changes. This happens when the write guard is dropped, after that guard's pages are noted. Each thread keeps the last copy it took until a generation counter says a new one exists.

  • Readers. writes_into, writes_since, nothing_new_in and nothing_new_min read from the table and the published asking. A batch's JournalRead now holds that snapshot instead of the lock. Writers still take the lock, so they only contend with each other.

  • Semantics. A check sees each page either as it was before a concurrent noting or as it is after it, exactly as when it took the lock before or after that noting.

    • A page it misses is found by the next check, which sees it written after the copy.
    • Asking numbers are taken at the same points as before.

With #472

  • The two merge without conflicts.
  • With both merged, cargo test -p victory-gpu --lib passes: 622 tests, including #472's summary_tracks_max_asking_per_bucket and the two new tests here.
  • Both note in Journal::note, so each stays exact.
  • Once both are in, the bitmap check in Shadow::nothing_new runs first. When it can't decide, the fallback no longer takes the lock either.
  • The two are complementary: the bitmap is a free first check for unchanged copies, and the mirror makes the rest cheap (about 0.5 µs per check, with no lock).

With #478

  • #478's VICTORY_JOURNAL_SHARDS splits the journal in shards. Sharded notes do not go through JournalMut::note, and the sharded path keeps its own asking ahead, so the mirror would miss both.
  • So this PR already makes the mirror stand aside whenever VICTORY_JOURNAL_SHARDS is set and not 0, read the same way #478 reads it. The journal is then read under its locks, whichever of the two lands first. The log says which way it is read.
  • A test covers that decision (the_mirror_stands_aside_for_a_sharded_journal).
  • The two still conflict as text in watch.rs, because #478 reworks much of it, including JournalRead.
  • The resolution is ready on the branch journal-mirror-on-478 of my fork: #478 with this PR on top (the commit). There, this PR's reading helpers also read the shards, and cargo test --workspace --locked passes. If #478 lands first, this PR is rebased onto it with that resolution.

Before and after

Setup: Ryzen 7 5700X, RTX 4070 SUPER, Series X profile, 3440x1440, DLSS performance. Same heavy scene in two play sessions: before, 7,027 indirect executions per frame; after, 7,448. Not a replay.

Version tested: builds of my fork based on v0.8.3.3 (main 7dbcdcb, the base of this PR).

  • The before and after builds differ only in this change.
  • Both ran with VICTORY_PORT_CONSTANTS=1, which is off by default upstream. Both also ran with my fork's VICTORY_HOME=1, which keeps hot runs of the title's big buffer in the card's memory and is not upstream.
  • So the absolute times are not comparable with a default setup. The difference between before and after is.
Per frame Before After
writes_into answered from the asking ahead or the published bits (~900 calls, all threads) 5-9 ms almost nothing
Noting into the journal (~80 calls) 4.8-7.3 ms 1.7 ms
Checks that a copy has nothing new in batches under the read lock 8,135 in 5.4 ms (~0.5 µs each)
Submitting thread, mean 53.5 ms 53.3 ms
Submitting thread, p90 71.7 ms 65.7 ms
Of which: asking the kernel's write watch 10.2 ms 11.6 ms
Of which: refreshes of host copies 15.3 ms 14.6 ms

To be clear about the limit:

  • The lock contention is gone, but the submitting thread's mean time did not change. What remains there is the kernel's write-watch asking and the copies themselves, not lock contention.
  • The lower p90 comes from two free-play sessions in a scene that was denser after. I would not count it as a gain without a replay.
  • @tillo88's replay-bench runs of #472 and #478, which reduce the same contention, found no measurable difference in frame rate either.

What this PR does give: the refreshes' journal reads no longer wait on writers, at no measured cost, with a switch to turn it off. It also includes the two diagnostics that showed where the submitting thread's time goes.

Diagnostics (off by default)

  • VICTORY_REFRESH_TOP=1: per frame, where writes_into spends its time; the split of the refresh flushes; and the copies whose refreshes cost most.
  • VICTORY_GUARDS_TOP=1: the guards' lock, counted by the place it is taken and by thread (submitting, asking, others), with times taken, wait, hold and longest hold.
    • In heavy scenes this showed 4-6 ms per frame on the submitting thread.
    • It also showed ~33 ms per frame of waits, summed, on the title's file-read threads in kernel_writing. Those waits do not correlate with frame spikes (r ≈ −0.01 over 251 one-second lines).

The three switches are added to the README's table of switches.

Checks

  • Three new tests: the mirror answers as the journal does; the asking ahead is published as it changes; the mirror stands aside for a sharded journal.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • The same check with --all-features: clean.
  • cargo test --workspace --locked: all pass.
  • cargo xtask policy: ok.

🤖 Generated with Claude Code

<!-- greyfinch-sync:readmet3xt-lab/foxhound:issue:5618367775 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/527). Originally posted by [BrenoMazini](https://github.com/BrenoMazini) on 2026-12-03T02:04:52Z. --- Follow-up to #472, as @GValdezN suggested there. #472 lets unchanged copies skip the `JOURNAL` lock with a hashed bitmap. This PR makes all of the refreshes' journal reads lock-free: `writes_into`, `writes_since` and both nothing-new checks. ## What Every refresh check took the write-watch journal's `RwLock`, and that lock was heavily contended: - per frame, ~900 `writes_into` calls and ~8,000 checks of copies known to copy nothing; - those 8,000 checks ran in batches of up to 256 under one read lock. A thread noting what the kernel or the guards found waited ~70 µs for the readers to leave. Windows' SRW lock blocks new readers while a writer waits, so every reader then queued behind that writer: ~7 µs for each `writes_into` answer. This PR adds `VICTORY_JOURNAL_MIRROR`: on by default, and `0` restores the old behaviour. - **Lock-free page table.** The pages' last askings are also kept in a table read without a lock: - one `AtomicU64` per 64 KiB page; - grouped in 256 MiB leaves, each created when a page in it is first noted; - beside each group of 64 pages, the group's latest asking, so checks skip groups that are old or were never written. Notes go in through the journal's write guard (`JournalMut::note`). - **Published asking ahead.** The asking ahead (its ranges, its number, whether it stands) is published as an `Arc` whenever it changes. This happens when the write guard is dropped, after that guard's pages are noted. Each thread keeps the last copy it took until a generation counter says a new one exists. - **Readers.** `writes_into`, `writes_since`, `nothing_new_in` and `nothing_new_min` read from the table and the published asking. A batch's `JournalRead` now holds that snapshot instead of the lock. Writers still take the lock, so they only contend with each other. - **Semantics.** A check sees each page either as it was before a concurrent noting or as it is after it, exactly as when it took the lock before or after that noting. - A page it misses is found by the next check, which sees it written after the copy. - Asking numbers are taken at the same points as before. ## With #472 - The two merge without conflicts. - With both merged, `cargo test -p victory-gpu --lib` passes: 622 tests, including #472's `summary_tracks_max_asking_per_bucket` and the two new tests here. - Both note in `Journal::note`, so each stays exact. - Once both are in, the bitmap check in `Shadow::nothing_new` runs first. When it can't decide, the fallback no longer takes the lock either. - The two are complementary: the bitmap is a free first check for unchanged copies, and the mirror makes the rest cheap (about 0.5 µs per check, with no lock). ## With #478 - #478's `VICTORY_JOURNAL_SHARDS` splits the journal in shards. Sharded notes do not go through `JournalMut::note`, and the sharded path keeps its own asking ahead, so the mirror would miss both. - So this PR already makes the mirror stand aside whenever `VICTORY_JOURNAL_SHARDS` is set and not `0`, read the same way #478 reads it. The journal is then read under its locks, whichever of the two lands first. The log says which way it is read. - A test covers that decision (`the_mirror_stands_aside_for_a_sharded_journal`). - The two still conflict as text in `watch.rs`, because #478 reworks much of it, including `JournalRead`. - The resolution is ready on the branch `journal-mirror-on-478` of my fork: #478 with this PR on top ([the commit](https://github.com/BrenoMazini/foxhound/commit/c55cd4196c08f84616740ee40ddb344158335bd3)). There, this PR's reading helpers also read the shards, and `cargo test --workspace --locked` passes. If #478 lands first, this PR is rebased onto it with that resolution. ## Before and after Setup: Ryzen 7 5700X, RTX 4070 SUPER, Series X profile, 3440x1440, DLSS performance. Same heavy scene in two play sessions: before, 7,027 indirect executions per frame; after, 7,448. Not a replay. Version tested: builds of my fork based on **v0.8.3.3** (main `7dbcdcb`, the base of this PR). - The before and after builds differ only in this change. - Both ran with `VICTORY_PORT_CONSTANTS=1`, which is off by default upstream. Both also ran with my fork's `VICTORY_HOME=1`, which keeps hot runs of the title's big buffer in the card's memory and is not upstream. - So the absolute times are not comparable with a default setup. The difference between before and after is. | Per frame | Before | After | |---|---|---| | `writes_into` answered from the asking ahead or the published bits (~900 calls, all threads) | 5-9 ms | almost nothing | | Noting into the journal (~80 calls) | 4.8-7.3 ms | 1.7 ms | | Checks that a copy has nothing new | in batches under the read lock | 8,135 in 5.4 ms (~0.5 µs each) | | **Submitting thread, mean** | **53.5 ms** | **53.3 ms** | | Submitting thread, p90 | 71.7 ms | 65.7 ms | | Of which: asking the kernel's write watch | 10.2 ms | 11.6 ms | | Of which: refreshes of host copies | 15.3 ms | 14.6 ms | To be clear about the limit: - The lock contention is gone, but the submitting thread's mean time did **not** change. What remains there is the kernel's write-watch asking and the copies themselves, not lock contention. - The lower p90 comes from two free-play sessions in a scene that was denser after. I would not count it as a gain without a replay. - @tillo88's replay-bench runs of #472 and #478, which reduce the same contention, found no measurable difference in frame rate either. What this PR does give: the refreshes' journal reads no longer wait on writers, at no measured cost, with a switch to turn it off. It also includes the two diagnostics that showed where the submitting thread's time goes. ## Diagnostics (off by default) - `VICTORY_REFRESH_TOP=1`: per frame, where `writes_into` spends its time; the split of the refresh flushes; and the copies whose refreshes cost most. - `VICTORY_GUARDS_TOP=1`: the guards' lock, counted by the place it is taken and by thread (submitting, asking, others), with times taken, wait, hold and longest hold. - In heavy scenes this showed 4-6 ms per frame on the submitting thread. - It also showed ~33 ms per frame of waits, summed, on the title's file-read threads in `kernel_writing`. Those waits do not correlate with frame spikes (r ≈ −0.01 over 251 one-second lines). The three switches are added to the README's table of switches. ## Checks - Three new tests: the mirror answers as the journal does; the asking ahead is published as it changes; the mirror stands aside for a sharded journal. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. - The same check with `--all-features`: clean. - `cargo test --workspace --locked`: all pass. - `cargo xtask policy`: ok. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GValdezN commented 2026-12-03 03:12:20 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by GValdezN on 2026-12-03T03:12:20Z.


Reviewed the full diff. The lock-free mirror design is clean — the semantics are correct, including the subtle factoring of ranged into mirror_each's above parameter in nothing_new_in (equivalent to the original .max(ranged) check). Memory ordering is right (Release stores, Acquire loads), and the temporary false negatives from the group→page store order are benign and documented. The JournalMut drop publishing the ahead while the write lock is still held is the key invariant that makes the whole thing work — pages are in the mirror before the asking that found them is visible to readers. No deadlock risk since mirror readers never hold the journal lock.

Two observations:

1. Integration with journal sharding (VICTORY_JOURNAL_SHARDS)

On our perf-quick-wins branch (commit 1bb2252), we added journal sharding, which splits JournalRead into JournalReadInner::Single and JournalReadInner::Sharded. This PR replaces JournalRead with JournalReading::Held and JournalReading::Mirror. If both land, the enum needs to handle three cases.

More importantly: with sharding enabled, notes go through sharded_note() → shard_write().note(), which does not call JournalMut::note — it writes directly to the per-shard journal. That means mirror_note would never be called for sharded notes, and the mirror would miss them. The mirror would need to hook into the sharded note path too, or the sharding would need to route through JournalMut.

This isn't a problem for merging this PR to main (sharding isn't there yet), but worth flagging for when both paths coexist.

2. Residual value of the summary bitmap (#472) with the mirror

Your measurements show the mirror handles ~8,135 nothing-new checks at ~0.5 µs each (~5.4 ms/frame total). The summary bitmap in #472 short-circuits most of these to ~0 µs when the copy hasn't changed — which is the common case at steady state. With both merged, the bitmap still saves most of that 5.4 ms/frame by skipping mirror_each entirely for unchanged copies. They're complementary fast paths at different levels: bitmap first (free), mirror second (cheap but not free).

Overall this looks solid — no correctness issues found.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7366314954 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/527#issuecomment-7366314954). Originally posted by [GValdezN](https://github.com/GValdezN) on 2026-12-03T03:12:20Z. --- Reviewed the full diff. The lock-free mirror design is clean — the semantics are correct, including the subtle factoring of `ranged` into `mirror_each`'s `above` parameter in `nothing_new_in` (equivalent to the original `.max(ranged)` check). Memory ordering is right (`Release` stores, `Acquire` loads), and the temporary false negatives from the group→page store order are benign and documented. The `JournalMut` drop publishing the ahead while the write lock is still held is the key invariant that makes the whole thing work — pages are in the mirror before the asking that found them is visible to readers. No deadlock risk since mirror readers never hold the journal lock. Two observations: **1. Integration with journal sharding (`VICTORY_JOURNAL_SHARDS`)** On our `perf-quick-wins` branch (commit `1bb2252`), we added journal sharding, which splits `JournalRead` into `JournalReadInner::Single` and `JournalReadInner::Sharded`. This PR replaces `JournalRead` with `JournalReading::Held` and `JournalReading::Mirror`. If both land, the enum needs to handle three cases. More importantly: with sharding enabled, notes go through `sharded_note()` → `shard_write().note()`, which does **not** call `JournalMut::note` — it writes directly to the per-shard journal. That means `mirror_note` would never be called for sharded notes, and the mirror would miss them. The mirror would need to hook into the sharded note path too, or the sharding would need to route through `JournalMut`. This isn't a problem for merging this PR to main (sharding isn't there yet), but worth flagging for when both paths coexist. **2. Residual value of the summary bitmap (#472) with the mirror** Your measurements show the mirror handles ~8,135 nothing-new checks at ~0.5 µs each (~5.4 ms/frame total). The summary bitmap in #472 short-circuits most of these to ~0 µs when the copy hasn't changed — which is the common case at steady state. With both merged, the bitmap still saves most of that 5.4 ms/frame by skipping `mirror_each` entirely for unchanged copies. They're complementary fast paths at different levels: bitmap first (free), mirror second (cheap but not free). Overall this looks solid — no correctness issues found.
BrenoMazini commented 2026-12-03 03:51:10 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-03T03:51:10Z.


Thanks for the careful review.

  1. Sharding. Confirmed in 1bb2252: sharded_note() goes straight to shard_write(..).note(), and the sharded path keeps its own asking ahead (GlobalAhead). With both switches on, the mirror would miss both the notes and the asking ahead, so a check could take a written page as unchanged.

    Rather than wait to see which lands first, I've added the guard here (18447a5): the mirror stands aside whenever VICTORY_JOURNAL_SHARDS is set and not 0, read the same way #478 reads it, and the journal is read under its locks. The log line says which way it is read, and a new test covers the decision.

    The two still conflict as text in watch.rs, since #478 reworks much of it. So I've also worked out how they fit once both are in, on the branch journal-mirror-on-478 of my fork: #478 with this PR on top, conflicts resolved (the commit).

    • The refreshes read the journal through this PR's four reading helpers, which also read the shards when the journal is split. JournalRead gets three cases: held, mirror, sharded.
    • With the shards on, the mirror still stands aside, as here.
    • cargo test --workspace --locked passes there, and clippy adds nothing beyond #478's own four collapsible_if.
    • With VICTORY_JOURNAL_SHARDS=1, two older tests fail (the_rest_of_the_one_asking_has_a_number_of_its_own, an_asking_begun_first_is_made_and_more_is_asked_for). They read the single journal directly and fail the same way on #478 alone.

    If #478 lands first, I'll rebase this PR onto it with that resolution. If this one lands first, #478 can take it from there. Routing the sharded notes through the mirror can come later, if both are wanted at once.

  2. The bitmap. Fair point. I had written that the bitmap would save little next to the mirror, and I've corrected the description. With both in, the bitmap is the free first check for unchanged copies, and the mirror makes what is left cheap.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7367004400 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/527#issuecomment-7367004400). Originally posted by [BrenoMazini](https://github.com/BrenoMazini) on 2026-12-03T03:51:10Z. --- Thanks for the careful review. 1. **Sharding.** Confirmed in 1bb2252: `sharded_note()` goes straight to `shard_write(..).note()`, and the sharded path keeps its own asking ahead (`GlobalAhead`). With both switches on, the mirror would miss both the notes and the asking ahead, so a check could take a written page as unchanged. Rather than wait to see which lands first, I've added the guard here (18447a5): the mirror stands aside whenever `VICTORY_JOURNAL_SHARDS` is set and not `0`, read the same way #478 reads it, and the journal is read under its locks. The log line says which way it is read, and a new test covers the decision. The two still conflict as text in `watch.rs`, since #478 reworks much of it. So I've also worked out how they fit once both are in, on the branch `journal-mirror-on-478` of my fork: #478 with this PR on top, conflicts resolved ([the commit](https://github.com/BrenoMazini/foxhound/commit/c55cd4196c08f84616740ee40ddb344158335bd3)). - The refreshes read the journal through this PR's four reading helpers, which also read the shards when the journal is split. `JournalRead` gets three cases: held, mirror, sharded. - With the shards on, the mirror still stands aside, as here. - `cargo test --workspace --locked` passes there, and clippy adds nothing beyond #478's own four `collapsible_if`. - With `VICTORY_JOURNAL_SHARDS=1`, two older tests fail (`the_rest_of_the_one_asking_has_a_number_of_its_own`, `an_asking_begun_first_is_made_and_more_is_asked_for`). They read the single journal directly and fail the same way on #478 alone. If #478 lands first, I'll rebase this PR onto it with that resolution. If this one lands first, #478 can take it from there. Routing the sharded notes through the mirror can come later, if both are wanted at once. 2. **The bitmap.** Fair point. I had written that the bitmap would save little next to the mirror, and I've corrected the description. With both in, the bitmap is the free first check for unchanged copies, and the mirror makes what is left cheap.
tillo88 commented 2026-12-04 00:47:11 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by tillo88 on 2026-12-04T00:47:11Z.


@BrenoMazini

Replay-bench measurement on v0.8.3.5: no measurable fps difference; CPU prep about 1 ms lower in both runs (base spread not known yet)

Measured: PR head 18447a5 merged onto release v0.8.3.5 (5e44415), with the PR's defaults (VICTORY_JOURNAL_MIRROR on, VICTORY_JOURNAL_SHARDS not set), 2 measured runs (after a warm-up run that is not counted), against 2 runs of v0.8.3.5 without the PR, same route (~6.5 min).

run fps CPU prep ms submitting thread ms median ms p95 ms p99 ms frames > 100 ms
release run 1 36.47 19.38 24.86 28.50 39.21 46.42 16
release run 2 36.45 19.10 25.17 28.70 39.06 45.68 17
PR #527 run 1 37.43 18.27 23.99 28.20 38.38 45.83 13
PR #527 run 2 36.91 18.04 24.00 28.40 39.49 46.05 16

Mean fps: release 36.46, PR 37.17 (+1.9%), below the bench's threshold for calling a run faster: no measurable difference in frame rate. CPU prep (about -1.1 ms) and the submitting thread's time (about -1.0 ms) were lower in both PR runs than in both release runs; frame-time percentiles and frames over 100 ms are within what the two release runs show. The v0.8.3.5 baseline has only 2 runs so far, so its run-to-run spread is not known yet: treat the prep difference as an observation, not a result.

Crashes: none in the PR runs and none in the release runs (no host GPU failure, no device lost).

Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default play-foxhound.ps1 settings (Series X profile, 1440p, DLSS balanced, no frame generation), fullscreen, no frame cap.

Update: the v0.8.3.5 baseline now has 5 runs. Three more release runs (37.23, 36.53, 37.10 fps) bring the release mean to 36.76 fps (range 36.45-37.23); against that the PR's 37.17 is +1.1%: no measurable difference in frame rate. CPU prep in the release runs: 18.49-19.38 ms (mean 18.98); submitting thread: 24.57-25.17 ms (mean 24.81). Both PR runs stayed below every release run on both (prep 18.27 / 18.04 ms, submitting thread 23.99 / 24.00 ms), so the roughly 0.8 ms lower CPU time holds against the wider baseline; it does not turn into frame rate on this machine.

Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7397159265 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/527#issuecomment-7397159265). Originally posted by [tillo88](https://github.com/tillo88) on 2026-12-04T00:47:11Z. --- @BrenoMazini **Replay-bench measurement on v0.8.3.5: no measurable fps difference; CPU prep about 1 ms lower in both runs (base spread not known yet)** Measured: PR head `18447a5` merged onto release **v0.8.3.5** (`5e44415`), with the PR's defaults (`VICTORY_JOURNAL_MIRROR` on, `VICTORY_JOURNAL_SHARDS` not set), 2 measured runs (after a warm-up run that is not counted), against 2 runs of v0.8.3.5 without the PR, same route (~6.5 min). | run | fps | CPU prep ms | submitting thread ms | median ms | p95 ms | p99 ms | frames > 100 ms | |---|---|---|---|---|---|---|---| | release run 1 | 36.47 | 19.38 | 24.86 | 28.50 | 39.21 | 46.42 | 16 | | release run 2 | 36.45 | 19.10 | 25.17 | 28.70 | 39.06 | 45.68 | 17 | | PR #527 run 1 | 37.43 | 18.27 | 23.99 | 28.20 | 38.38 | 45.83 | 13 | | PR #527 run 2 | 36.91 | 18.04 | 24.00 | 28.40 | 39.49 | 46.05 | 16 | Mean fps: release 36.46, PR 37.17 (+1.9%), below the bench's threshold for calling a run faster: **no measurable difference** in frame rate. CPU prep (about -1.1 ms) and the submitting thread's time (about -1.0 ms) were lower in both PR runs than in both release runs; frame-time percentiles and frames over 100 ms are within what the two release runs show. The v0.8.3.5 baseline has only 2 runs so far, so its run-to-run spread is not known yet: treat the prep difference as an observation, not a result. Crashes: none in the PR runs and none in the release runs (no host GPU failure, no device lost). Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default `play-foxhound.ps1` settings (Series X profile, 1440p, DLSS balanced, no frame generation), fullscreen, no frame cap. **Update: the v0.8.3.5 baseline now has 5 runs.** Three more release runs (37.23, 36.53, 37.10 fps) bring the release mean to 36.76 fps (range 36.45-37.23); against that the PR's 37.17 is **+1.1%: no measurable difference** in frame rate. CPU prep in the release runs: 18.49-19.38 ms (mean 18.98); submitting thread: 24.57-25.17 ms (mean 24.81). Both PR runs stayed below every release run on both (prep 18.27 / 18.04 ms, submitting thread 23.99 / 24.00 ms), so the roughly 0.8 ms lower CPU time holds against the wider baseline; it does not turn into frame rate on this machine. Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.
BrenoMazini commented 2026-12-04 01:02:57 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-04T01:02:57Z.


Thank you for this, and for going back to widen the baseline to five runs before drawing anything from it.

Your reading matches what the PR is meant to do. It takes lock waits off the CPU side of the refreshes, and both of your PR runs stayed below every release run on prep and on the submitting thread, by about 0.8-1 ms. That this doesn't reach the frame rate on a 9800X3D makes sense to me: the CPU isn't what limits the frame there. On my 5700X the lock waits were larger (noting into the journal went from 4.8-7.3 ms to 1.7 ms a frame), but my before and after were two play sessions, not a replay, and with the port and my fork's home on. So your numbers are the cleaner evidence that the change is safe and consistent.

If a run on a CPU-bound setup would help, I can do a controlled set here: my 0.8.3.5-based build on the stock path (port and home off), same spot and scripted camera path, with VICTORY_JOURNAL_MIRROR=0 and 1 alternated.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7397423875 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/527#issuecomment-7397423875). Originally posted by [BrenoMazini](https://github.com/BrenoMazini) on 2026-12-04T01:02:57Z. --- Thank you for this, and for going back to widen the baseline to five runs before drawing anything from it. Your reading matches what the PR is meant to do. It takes lock waits off the CPU side of the refreshes, and both of your PR runs stayed below every release run on prep and on the submitting thread, by about 0.8-1 ms. That this doesn't reach the frame rate on a 9800X3D makes sense to me: the CPU isn't what limits the frame there. On my 5700X the lock waits were larger (noting into the journal went from 4.8-7.3 ms to 1.7 ms a frame), but my before and after were two play sessions, not a replay, and with the port and my fork's home on. So your numbers are the cleaner evidence that the change is safe and consistent. If a run on a CPU-bound setup would help, I can do a controlled set here: my 0.8.3.5-based build on the stock path (port and home off), same spot and scripted camera path, with `VICTORY_JOURNAL_MIRROR=0` and `1` alternated.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/527:upstream-pr/527'
git switch 'upstream-pr/527'

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 'upstream-pr/527'
git switch 'upstream-pr/527'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/527'
git switch 'upstream-pr/527'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/527'
git switch 'main'
git merge --squash 'upstream-pr/527'
git switch 'main'
git merge --ff-only 'upstream-pr/527'
git switch 'main'
git merge 'upstream-pr/527'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
readmet3xt-lab/foxhound!527
No description provided.