Making VICTORY_PORT_CONSTANTS pay on CPU-bound PCs: a VRAM copy of the culling's atomic ranges gave +15-22 % fps here. Full data inside; help, tests and ideas wanted #586

Open
opened 2026-12-04 00:53:41 +00:00 by BrenoMazini · 2 comments
BrenoMazini commented 2026-12-04 00:53:41 +00:00 (Migrated from github.com)
Contributor

Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-04T00:53:41Z.


foxhound version: 0.8.3.5 (5e44415) with my fork's changes on top. The earlier measurements below were made on the build of my fork described in #532's controlled runs. Each section says which.

GPU / CPU / RAM / Windows: RTX 4070 SUPER 12 GB / Ryzen 7 5700X (8 cores, 16 threads) / 32 GB / Windows 11. Fixed pagefile of 32-48 GB (commit limit about 64 GB). Resizable BAR on (16 GB BAR1); foxhound's paths that use it (VICTORY_WC_BAR, VICTORY_SEND_BAR) were off in every run.

Launcher settings (resolution, DLSS, Frame Generation, VRAM limit): 3440x1440, DLSS Performance, Frame Generation off, VRAM limit not set

What happens, and when:

This is not a bug report. It is the full record of a feature in my fork, the "home", written for two audiences:

  • the maintainers, to decide whether they want it upstream before I spend time making it general (section 9);
  • anyone working on the renderer, or with a PC like mine, to check what I found, point out what I got wrong, and add what they know or can measure ("How you can help", below).

#532 and #572 mention it in passing. This issue puts everything in one place: what it does, what it gave, what it costs, what I tried and dropped, what I'm testing now, and what I don't know.

In short

Corrected on 2026-12-04, after re-checking my logs and results: the title and this summary gave only the larger of the two gains, the defaults' p95 in section 4 came from one series only, and section 1 mixed a value from the standing phase into the port's preparing time. The numbers below are the corrected ones. No conclusion changed.

  • With VICTORY_PORT_CONSTANTS=1, the title's large shared buffer stays in system RAM and the card reaches it over PCIe. The culling programs change a few small ranges of that buffer with atomic operations, tens of times a frame, and each atomic over PCIe is a round trip on the bus.
  • The home keeps a copy of those ranges in the card's memory and keeps it in agreement with the title's memory around every submission that uses it.
  • On this PC, in controlled runs, the port with the home gave +15 to +22 % fps over the defaults: 14.7 against 12.8 fps in the series where the two alternated run by run, and 15.1 against 12.4 in the other. In that second series, GUARD_PAGES=1 gave 13.7 fps, so the home was about 10 % above it. The card's time in compute dispatches fell from about 40 ms to 17-19 ms a frame.
  • It costs more long frames than GUARD_PAGES=1 (p95 105-111 ms against 86 ms), more work on the submitting thread, and it only helps where the port is on.
  • It needs data about the title (where the ranges are, and a few programs), which the asset policy keeps out of the code. That is why this is a question and not a PR.

How you can help

Testing the home itself needs my fork and the title's values, which I can't post. Until there's a way to carry those values (question 3 in section 9), these are the things that would help most, and none of them needs the home:

  • Measure the port on your PC. With VICTORY_PROFILE=1 and VICTORY_PROFILE_TOP=1, run the same spot and camera path with VICTORY_PORT_CONSTANTS=1 and without it, and post the card busy, the card profile's time in dispatches, and the submitting thread's preparing line from the 5-second lines. That would show how much the culling's atomics over PCIe cost on other cards and buses, which is the cost the home removes.
  • Tell me where your PC sits. The home only pays where the CPU is the limit and the card has room to spare (card under ~70 % busy on the stock path). If your PC is like that (for example a 6- or 8-core CPU with a card of the 4070 class or above, at 1440p-class resolutions with DLSS; mine is 3440x1440 with DLSS Performance), your numbers on the port matter most.
  • Check what I say about the culling. If you have looked at the culling programs or at the shared buffer (as tavochivix did in #532), does what I describe in sections 1 and 5 match what you see? In particular: are there other ranges or counters the culling changes with atomics, and is anything else reading them that I may have missed?
  • Ideas for the two open problems:
    • how to know which pages the CPU wrote in memory that is a section view, where Windows' write watch doesn't answer (section 6). That is what would make the pulls cheap;
    • how the engine could find the ranges by itself, so no profile values are needed (section 9, question 2).
  • Point out what I got wrong. If a number, a reading of the logs or a conclusion here doesn't hold, say so. I'd rather correct it now than build a PR on it.

When you post numbers, please follow the template's rules: no names from the game, no files or captures from it, and the game folder replaced by <game> in logs.

1. Why it exists: the cost of atomics over PCIe

What the port does on this PC (controlled runs in #532, same spot, same scripted camera turn):

while turning defaults port alone
fps 12.4-12.8 12.7
card busy ~56 % ~99 %
submitting thread, preparing (ms/frame) ~65-67 ~34
card time in compute dispatches (ms/frame) ~8.5 ~40

The port takes the copying work off the CPU, but the card pays for it, and the frame rate stays where it was.

Where the card's extra time goes:

  • Without the port, the culling costs the card under 1 ms a frame. With the port, it cost 15-25 ms.
  • A diagnostic I ran early on shows how expensive atomics over PCIe are. It added one atomic OR per memory access, into a buffer of ours in system memory, to some programs. The game fell from about 13 fps to 5.6 fps with 4 programs instrumented, and to 0.5 fps with the 9 culling programs.
  • The culling does its atomics inside the same few MiB, tens of times a frame.

2. How it works

It is off by default (VICTORY_HOME=1 turns it on), and it turns itself off with a warning without PORT_CONSTANTS=1.

The ranges. Up to four ranges of the shared buffer, given in MiB (VICTORY_HOME_RUNS). In this title, two ranges, 4 MiB in total. The home is two buffers of that size in the card's memory: the copy, and a snapshot of the last state both sides agreed on.

The translator. In the culling programs (the profile's pass.* roles) and in programs named in VICTORY_HOME_PROGRAMS:

  • every raw dword access (load, store or atomic) whose byte lies inside a range goes, in a conditional block, to the copy through a root UAV of its own, at the same offset within the range;
  • atomics become the same atomic on the copy;
  • accesses outside the ranges still go to the title's memory;
  • the shaders get their own cache key, so turning the home on or off translates anew.

This is safe in this title because the small views the culling uses are all under 1 MB, so an offset that large only exists in the view of the whole buffer, whose base is the buffer's start.

The host side.

  • Table views and root views that lie entirely inside a range are made on the copy.
  • Views that cross a range's border stay on the title's memory. They are counted, and in practice there are almost none.
  • Only the descriptors point to the copy. Addresses and the map from card addresses to the title's memory stay on the original, because an earlier attempt that moved more than the descriptors crashed.

Keeping both sides in agreement. This is the core. Around every submission whose lists used the home, on the same queue:

  • Pull, before: brings in what the CPU wrote. The ranges are block-copied from the title's memory into a staging area in the card's memory (VICTORY_HOME_PULL_COPY, on by default). A program of ours then compares each dword with the snapshot; where the title's memory differs, it writes the new value into both the copy and the snapshot.
  • Push, after, before the submission's signal: sends out what the card wrote. Where the copy differs from the snapshot, the value goes to the title's memory and to the snapshot.
  • This is a three-way merge with the snapshot as the common ancestor:
    • a CPU write to a dword the card didn't touch is kept, even with a submission in flight;
    • if both sides wrote the same dword in between, the card's value wins. On the console that would be a race too.
  • Pushes inside a list, so that nothing reads stale data from the title's memory:
    • before an indirect execution whose arguments or count lie in a range;
    • before a program that binds the whole buffer without the home.
  • Indirect arguments that lie inside the ranges are read from the copy (VICTORY_HOME_ARGS, on by default).

The log line, every 5 s:

  • pulls and pushes a frame, and pushes inside lists;
  • binds with the home, and views and root views made on it;
  • what stayed on the title's memory;
  • the programs that see the whole buffer without the home;
  • with VICTORY_PROFILE=1, the card time of each pull and push.

3. What each part gave, in the order I built it

Single sessions, not controlled runs. Only the card-side numbers compare across sessions.

step result
first working version with the port, the card's time in the title's lists fell from ~96 ms (port alone) to ~45 ms a frame (port + home); no warnings or errors
indirect arguments read from the copy no gain on the card: cost per command unchanged. Kept, because it removes pushes and costs nothing
a pull, read by a shader ~310 µs of card time for 4 MiB (~13.5 GB/s over PCIe), ~14 a frame: ~4.3 ms a frame
16-byte reads per thread in the pull 310 → 302 µs: the limit is the bus, not the number of reads
pull by block copy (HOME_PULL_COPY) 296 → 249 µs (~18 GB/s), about 0.6 ms a frame less. Kept, on by default
what a pull actually brings on average 23 of the 1,024 4 KiB pages change between pulls (~2.3 %). Every page changes at some point, so there is no fixed subset

That last row means ~97 % of each pull is wasted. The obvious fix, pulling only the pages the CPU wrote, can't work under the port (section 6).

4. Controlled results

Same spot, same direction, at least 30 s to settle, then input only from VICTORY_KEYS_FILE: 20 s to settle, 60 s standing, 24 s turning the camera. Configurations alternated. I read the turning phase, where the load per frame stays within a few percent across runs. The method is described in full in #532.

Series 1 and 2 (the build of #532's controlled runs):

while turning fps (series 1 / series 2) card busy p95, ms (series 1 / series 2)
defaults 12.8 / 12.4 ~56-57 % 114 / 96
GUARD_PAGES=1 - / 13.7 ~58 % - / 86
port alone 12.7 / - ~99 % 109 / -
port + home 14.7 / 15.1 ~88-91 % 107 / 105
port + home + GUARD_PAGES=1 - / 15.1 ~86 % - / 111

Series 1 alternated the defaults, the port and the port with the home run by run (A B C C B A). Series 2 ran the defaults against GUARD_PAGES=1 (A AG AG A), then the port with the home against the same plus GUARD_PAGES=1 (C CG CG C), so in series 2 the defaults and the home were not alternated with each other. That is why I give both gains: +15 % in series 1, +22 % in series 2.

  • The home took the card's time in compute dispatches from 35-40 ms to 18-19 ms a frame. Its pulls cost about 3.5 ms of card time a frame.
  • Against the port alone, it adds 3-8 ms a frame on the submitting thread, mostly in write-watch asking, refreshes and copies.
  • Texture loading was the same in the three configurations (about 27 thousand in the queue, 60-70 s to drain).
  • GUARD_PAGES=1 adds nothing on top of the port and the home. With the port, there is far less left to copy.

Thread series (0.8.3.5 + my fork, #572):

  • With the port and the home, the card is the limit for the typical frame, and the frames over 100 ms are those where the submitting thread prepares for too long.
  • With VICTORY_THIN_THREADS=6 instead of 8, the frames over 100 ms fell from 18-23 % to 9-12 % (two runs each), with the same median.

5. Where the card still pays with the port and the home

Same build, turning phase: the stock path with GUARD_PAGES=1 against the port and the home.

card time a frame stock + guard pages port + home
the title's lists ~33 ms ~60 ms
indirect draws 13.3 26.5
dispatches 9.2 18.9
indirect dispatches 5.8 8.0
mesh 3.4 5.6
our own lists 4.3 1.1
indirect executions a frame 6,360 7,770
card time per thousand executions 5.2 ms 7.8 ms
  • At the same density, the port and the home still cost the card about 20 ms a frame more than the stock path. That is reads of the title's memory over PCIe, outside the home.
  • The ten programs with the most excess account for ~13 ms. The rest is spread out, about 1.4x per call in whatever reads the title's memory.
  • The largest single item is one culling program that writes ~2 MiB elsewhere in the buffer, scattered, over PCIe.
  • Several costly mesh programs bind the whole buffer and read other parts of it.

6. What I tried and dropped

  • Pulling only the pages the CPU wrote (HOME_SPARSE).
    • Windows' write watch only exists for private memory.
    • Under the port, the title's graphics pages are views of a section, because that's how the console's physical-page model is emulated. So the write watch has nothing to report for the ranges.
    • Making that memory private instead isn't possible without rewriting that memory model, because the title maps and unmaps those pages itself.
    • The code falls back to whole pulls by itself, with a warning. It would stay out of a PR.
  • A separate copy queue for the pulls. Each pull must see the previous submission's push already written. So the copy can only start when that submission ends on the card, and the next one waits for it: there's nothing to overlap.
  • Widening the home to the ~2 MiB the culling writes.
    • Dispatches fell ~4 ms a frame.
    • But the CPU also writes part of that range, so its pages come up in every pull, and pulls cost +1.9 ms.
    • Net: ~2 ms of card time a frame. The frame time stayed within the run-to-run spread, so I didn't keep it.
    • (Section 7: a learned pull now makes this range cheaper to keep in the home.)
  • "Quiet" ranges: adding ranges that the culling and the costliest mesh programs read, but pulling them only every 16th pull.
    • Objects flickered.
    • A counter of ours showed the title's memory in those ranges changing about 100 thousand dwords between full pulls. They are not quiet, and pulling them late means stale reads.
    • Dropped after one run.

7. What I'm testing now, and what is still open

Updated on 2026-12-04 with what the first two items gave. In short: each of them did what it was meant to do on the card or the threads, but on this PC the frame time varies between loads more than either effect, so I can't claim a frame-rate gain from them. All of this comes from short, quick tests in a controlled setting (the same spot and scripted camera turn as in section 4, about two minutes each, two runs per configuration), so please take it as a first look, not as settled results.

  • The lists' scratch buffers (VICTORY_SCRATCH_KEEP_MB=1024). This is not the home, but it is on the same configuration.
    • The list translators wait for new buffers to become resident: about 26 ms a frame, summed over the threads.
    • On a 32 GB PC the spares are trimmed back to VICTORY_SPARE_WARM_MB every frame while the host is under memory pressure, so that key has to be raised too.
    • Result: with both keys, the waits went away. The typical frame looked slightly better and the long frames moved both ways, all within the run-to-run spread. I haven't put it in my launcher.
  • A learned pull, now in my fork, off by default.
    • The counted pulls, read back, tell which pages changed. Once that set stops growing, a pull copies only those pages, and every N-th pull stays whole and adds any new page.
    • Here the set stopped growing a few seconds after loading. A check run first, with whole pulls, found no page a learned pull would have missed after that.
    • With it on, the widened range from section 6 costs much less on the card. In short runs, one new page arrived late once, and nothing flickered.
    • I'm using it day to day to look for problems over longer sessions, not presenting it as a gain.
  • CPU waits for the card in the title's copies inside card memory: about 10 waits and 4.8 ms a frame. I haven't yet looked at which thread waits, or whether they can be deferred.
  • The mesh programs that read the whole buffer: the rest of the PCIe cost, ~5-7 ms.
    • They would have to be named for the home, and reads of 8 or 16 bits, typed reads and indexed reads are not redirected today.
    • High risk; I would measure it as a diagnostic first.
  • A quick read of the code around the submitting thread (added on 2026-12-04). While I couldn't run the game, I read the code and the logs I already had to see where the submitting thread waits. This was a quick check, and part of it is my own reading of the code, not measured yet. The proportions below come from a short timeline taken with a diagnostics build, which is slower than the normal one and adds its own cost to every call it records, so only the shares mean something, not the absolute times. All of these numbers come from my own PC (Ryzen 7 5700X, RTX 4070 SUPER, 3440x1440), so another machine may well give different results; seeing how each machine responds is exactly the point of sharing them. I'll test each point later with a key at a time, alternating runs, and post what holds and what doesn't. I left out what open or earlier PRs already studied. If anyone knows these paths better, corrections are very welcome.
    • The submitting thread is idle about half the time in that timeline, waiting for the next submission. What seems to cost is the waiting inside each submission, which delays the title's present and leaves the card waiting for the list, more than the total work.
    • The write-watch asking (about 11 ms a frame in my normal logs) is ~93 % waiting for the thread that asks the kernel (ask_first):
      • about a third of that is GetWriteWatch itself, which here costs 3-4 times what the code's comment measured upstream (0.3 µs a call plus 0.5-1.1 µs per MiB walked). The calls that overlap a VirtualProtect on another thread cost 5-11 times that. My guess is that both take the same address-space lock in the kernel, but I haven't confirmed it.
      • In my normal logs the kernel walks ~400-450 thousand pages a frame to find ~2-3.5 thousand written ones. VICTORY_ASK_NEAR=1 (512 KiB instead of 8 MiB) would walk far less; it has never been measured here.
    • The guard faults cost the title's threads a lot in that timeline: their VirtualProtect calls (opening a 64 KiB block) added up to 21-39 ms of thread time a frame, 0.3 ms each alone and 1.0-1.8 ms when a GetWriteWatch ran at the same time. To see what the normal build pays, I added a log line behind a new key that is off by default (VICTORY_FAULT_TIME=1, only in my local build for now): write faults per frame by the way they went, their time, and the VirtualProtect calls in faults, opening and guarding again.
    • The copies' refreshes spend 27-42 % of their time waiting for the guards' lock (watch::guards; my build has #527's journal mirror, so this isn't the journal's lock). The guards' lock is also taken by the title's streaming threads (writing() before a file read), the faults that go the locked way, guard_ahead and the runtime's memory notices, and guarding a block again (VirtualProtect in guard_locked) is done with it held. #434 already moves those calls outside the lock; its replay bench on a fast CPU saw no difference, so a slower CPU like this one may be where it shows. I'll first measure who holds the lock in the normal build (VICTORY_GUARDS_TOP=1, VICTORY_REFRESH_TOP=1) and then try #434 here.
    • VICTORY_GUARD_HOT=50 (the launcher's value) leaves a block the title writes again and again open for 50 ms. docs/findings.md measured it in scenes of roughly 35-55 ms frames, so about one frame or a bit more. My frames are longer (about 70 ms), so 50 ms is less than one frame: if I read it right, a block written every frame is guarded again and faults again every frame. I'll try 150 ms.
    • The waits for flights are rare but long: about once every ten frames (sometimes less often) a small fill of upload memory waits for the flights to land, 15-20 ms each time. The code already has an option for this case, off by default (VICTORY_FILL_TITLE=1), with a stated risk (a constant read stale). I'll try it on its own and watch for visual faults.
    • None of this is a promise of a gain: the card itself is busy most of the frame here, so at best these points would reduce the time the card stands idle and the long frames.

8. What I don't know, and the risks

  • One PC, one title. On a PC whose card has no room to spare, the port loses badly (21.3 → 5.6 fps in tavochivix's 4K runs in #532). I don't know whether the home wins that back.
  • The program list. A program that writes the ranges without being translated for the home would read or leave stale data. That would most likely show as a visual fault, not a crash. The log names the programs that see the whole buffer without the home, so they can be checked.
  • Descriptors made before the large buffer is first seen stay on the title's memory.
  • The conflict rule ("the card wins on the same dword") follows from the merge. It has not caused anything I could see, but it is a rule, not a proof.
  • Visual checks. The visual faults I have seen in this title (late textures, some objects missing) happen with and without the home, and no new ones appeared with it. I have checked part of the game, not all of it.
  • More long frames than with GUARD_PAGES=1, as above.

9. What a PR would contain, and the questions

A PR would contain only what is measured and kept:

  • the translator rule;
  • the host-side views;
  • pull and push with the merge;
  • the pushes inside lists;
  • arguments read from the copy;
  • the block-copy pull;
  • the log line;
  • tests;
  • off by default, and only with the port.

It would leave out the sparse pull, the quiet ranges and everything from section 7. And it would carry no values for any title:

  • The culling programs are already named by the profile's pass.* roles.
  • The other programs would be a new role. An engine that doesn't know a role leaves it out with a line, so older engines still read such a profile.
  • The ranges would need a new profile entry. Unknown keys refuse the whole file, so a profile with that entry would be refused by older engines.

My questions:

  1. Would a PR like this be welcome? Or would you rather keep the port as it is, or solve the culling's atomics over PCIe another way?
  2. If yes, where should the ranges come from?
    • A profile entry, with a format change or some other way you prefer so older engines aren't broken.
    • Or the engine finding them itself: under the port, it would note which pages of the shared buffer the culling programs reach with atomics, and keep those in the card's memory. That needs no profile values, but it is more work and more risk.
  3. Profiles aren't distributed from this repository. If the values go into profiles, who would add them, so that others with a similar PC can test it?

If the answer is no, that's fine: the home stays in my fork, and I'll keep posting what I measure.

Log: not attached, because the logs carry the title profile's shader ids. I can post the summary lines (frame times:, card profile, home (VICTORY_HOME) per frame) from any of the runs above, with the game folder replaced by <game>.

As in my other reports, I made the runs and the configuration, and a model (Claude) read the logs and helped with the code. Every number comes from the logs.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:issue:6781946271 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/issues/586). Originally posted by [BrenoMazini](https://github.com/BrenoMazini) on 2026-12-04T00:53:41Z. --- **foxhound version:** 0.8.3.5 (5e44415) with my fork's changes on top. The earlier measurements below were made on the build of my fork described in #532's controlled runs. Each section says which. **GPU / CPU / RAM / Windows:** RTX 4070 SUPER 12 GB / Ryzen 7 5700X (8 cores, 16 threads) / 32 GB / Windows 11. Fixed pagefile of 32-48 GB (commit limit about 64 GB). Resizable BAR on (16 GB BAR1); foxhound's paths that use it (`VICTORY_WC_BAR`, `VICTORY_SEND_BAR`) were off in every run. **Launcher settings (resolution, DLSS, Frame Generation, VRAM limit):** 3440x1440, DLSS Performance, Frame Generation off, VRAM limit not set **What happens, and when:** This is not a bug report. It is the full record of a feature in my fork, the "home", written for two audiences: - **the maintainers**, to decide whether they want it upstream before I spend time making it general (section 9); - **anyone working on the renderer, or with a PC like mine**, to check what I found, point out what I got wrong, and add what they know or can measure ("How you can help", below). #532 and #572 mention it in passing. This issue puts everything in one place: what it does, what it gave, what it costs, what I tried and dropped, what I'm testing now, and what I don't know. ## In short *Corrected on 2026-12-04, after re-checking my logs and results: the title and this summary gave only the larger of the two gains, the defaults' p95 in section 4 came from one series only, and section 1 mixed a value from the standing phase into the port's preparing time. The numbers below are the corrected ones. No conclusion changed.* - With `VICTORY_PORT_CONSTANTS=1`, the title's large shared buffer stays in system RAM and the card reaches it over PCIe. The culling programs change a few small ranges of that buffer with atomic operations, tens of times a frame, and each atomic over PCIe is a round trip on the bus. - The home keeps a copy of those ranges in the card's memory and keeps it in agreement with the title's memory around every submission that uses it. - On this PC, in controlled runs, the port with the home gave **+15 to +22 % fps** over the defaults: 14.7 against 12.8 fps in the series where the two alternated run by run, and 15.1 against 12.4 in the other. In that second series, `GUARD_PAGES=1` gave 13.7 fps, so the home was about 10 % above it. The card's time in compute dispatches fell from about 40 ms to 17-19 ms a frame. - It costs more long frames than `GUARD_PAGES=1` (p95 105-111 ms against 86 ms), more work on the submitting thread, and it only helps where the port is on. - It needs data about the title (where the ranges are, and a few programs), which the asset policy keeps out of the code. That is why this is a question and not a PR. ## How you can help Testing the home itself needs my fork and the title's values, which I can't post. Until there's a way to carry those values (question 3 in section 9), these are the things that would help most, and none of them needs the home: - **Measure the port on your PC.** With `VICTORY_PROFILE=1` and `VICTORY_PROFILE_TOP=1`, run the same spot and camera path with `VICTORY_PORT_CONSTANTS=1` and without it, and post the card busy, the card profile's time in dispatches, and the submitting thread's preparing line from the 5-second lines. That would show how much the culling's atomics over PCIe cost on other cards and buses, which is the cost the home removes. - **Tell me where your PC sits.** The home only pays where the CPU is the limit and the card has room to spare (card under ~70 % busy on the stock path). If your PC is like that (for example a 6- or 8-core CPU with a card of the 4070 class or above, at 1440p-class resolutions with DLSS; mine is 3440x1440 with DLSS Performance), your numbers on the port matter most. - **Check what I say about the culling.** If you have looked at the culling programs or at the shared buffer (as tavochivix did in #532), does what I describe in sections 1 and 5 match what you see? In particular: are there other ranges or counters the culling changes with atomics, and is anything else reading them that I may have missed? - **Ideas for the two open problems:** - how to know which pages the CPU wrote in memory that is a section view, where Windows' write watch doesn't answer (section 6). That is what would make the pulls cheap; - how the engine could find the ranges by itself, so no profile values are needed (section 9, question 2). - **Point out what I got wrong.** If a number, a reading of the logs or a conclusion here doesn't hold, say so. I'd rather correct it now than build a PR on it. When you post numbers, please follow the template's rules: no names from the game, no files or captures from it, and the game folder replaced by `<game>` in logs. ## 1. Why it exists: the cost of atomics over PCIe What the port does on this PC (controlled runs in #532, same spot, same scripted camera turn): | while turning | defaults | port alone | |---|---|---| | fps | 12.4-12.8 | 12.7 | | card busy | ~56 % | ~99 % | | submitting thread, preparing (ms/frame) | ~65-67 | ~34 | | card time in compute dispatches (ms/frame) | ~8.5 | ~40 | The port takes the copying work off the CPU, but the card pays for it, and the frame rate stays where it was. Where the card's extra time goes: - Without the port, the culling costs the card under 1 ms a frame. With the port, it cost 15-25 ms. - A diagnostic I ran early on shows how expensive atomics over PCIe are. It added one atomic OR per memory access, into a buffer of ours in system memory, to some programs. The game fell from about 13 fps to 5.6 fps with 4 programs instrumented, and to 0.5 fps with the 9 culling programs. - The culling does its atomics inside the same few MiB, tens of times a frame. ## 2. How it works It is off by default (`VICTORY_HOME=1` turns it on), and it turns itself off with a warning without `PORT_CONSTANTS=1`. **The ranges.** Up to four ranges of the shared buffer, given in MiB (`VICTORY_HOME_RUNS`). In this title, two ranges, 4 MiB in total. The home is two buffers of that size in the card's memory: the copy, and a snapshot of the last state both sides agreed on. **The translator.** In the culling programs (the profile's `pass.*` roles) and in programs named in `VICTORY_HOME_PROGRAMS`: - every raw dword access (load, store or atomic) whose byte lies inside a range goes, in a conditional block, to the copy through a root UAV of its own, at the same offset within the range; - atomics become the same atomic on the copy; - accesses outside the ranges still go to the title's memory; - the shaders get their own cache key, so turning the home on or off translates anew. This is safe in this title because the small views the culling uses are all under 1 MB, so an offset that large only exists in the view of the whole buffer, whose base is the buffer's start. **The host side.** - Table views and root views that lie entirely inside a range are made on the copy. - Views that cross a range's border stay on the title's memory. They are counted, and in practice there are almost none. - Only the descriptors point to the copy. Addresses and the map from card addresses to the title's memory stay on the original, because an earlier attempt that moved more than the descriptors crashed. **Keeping both sides in agreement.** This is the core. Around every submission whose lists used the home, on the same queue: - **Pull, before:** brings in what the CPU wrote. The ranges are block-copied from the title's memory into a staging area in the card's memory (`VICTORY_HOME_PULL_COPY`, on by default). A program of ours then compares each dword with the snapshot; where the title's memory differs, it writes the new value into both the copy and the snapshot. - **Push, after, before the submission's signal:** sends out what the card wrote. Where the copy differs from the snapshot, the value goes to the title's memory and to the snapshot. - This is a three-way merge with the snapshot as the common ancestor: - a CPU write to a dword the card didn't touch is kept, even with a submission in flight; - if both sides wrote the same dword in between, the card's value wins. On the console that would be a race too. - **Pushes inside a list**, so that nothing reads stale data from the title's memory: - before an indirect execution whose arguments or count lie in a range; - before a program that binds the whole buffer without the home. - **Indirect arguments** that lie inside the ranges are read from the copy (`VICTORY_HOME_ARGS`, on by default). **The log line,** every 5 s: - pulls and pushes a frame, and pushes inside lists; - binds with the home, and views and root views made on it; - what stayed on the title's memory; - the programs that see the whole buffer without the home; - with `VICTORY_PROFILE=1`, the card time of each pull and push. ## 3. What each part gave, in the order I built it Single sessions, not controlled runs. Only the card-side numbers compare across sessions. | step | result | |---|---| | first working version | with the port, the card's time in the title's lists fell from ~96 ms (port alone) to ~45 ms a frame (port + home); no warnings or errors | | indirect arguments read from the copy | **no gain on the card**: cost per command unchanged. Kept, because it removes pushes and costs nothing | | a pull, read by a shader | ~310 µs of card time for 4 MiB (~13.5 GB/s over PCIe), ~14 a frame: ~4.3 ms a frame | | 16-byte reads per thread in the pull | 310 → 302 µs: the limit is the bus, not the number of reads | | pull by block copy (`HOME_PULL_COPY`) | 296 → 249 µs (~18 GB/s), about 0.6 ms a frame less. Kept, on by default | | what a pull actually brings | on average 23 of the 1,024 4 KiB pages change between pulls (~2.3 %). Every page changes at some point, so there is no fixed subset | That last row means ~97 % of each pull is wasted. The obvious fix, pulling only the pages the CPU wrote, can't work under the port (section 6). ## 4. Controlled results Same spot, same direction, at least 30 s to settle, then input only from `VICTORY_KEYS_FILE`: 20 s to settle, 60 s standing, 24 s turning the camera. Configurations alternated. I read the turning phase, where the load per frame stays within a few percent across runs. The method is described in full in #532. **Series 1 and 2** (the build of #532's controlled runs): | while turning | fps (series 1 / series 2) | card busy | p95, ms (series 1 / series 2) | |---|---|---|---| | defaults | 12.8 / 12.4 | ~56-57 % | 114 / 96 | | `GUARD_PAGES=1` | - / 13.7 | ~58 % | - / 86 | | port alone | 12.7 / - | ~99 % | 109 / - | | port + home | 14.7 / 15.1 | ~88-91 % | 107 / 105 | | port + home + `GUARD_PAGES=1` | - / 15.1 | ~86 % | - / 111 | Series 1 alternated the defaults, the port and the port with the home run by run (A B C C B A). Series 2 ran the defaults against `GUARD_PAGES=1` (A AG AG A), then the port with the home against the same plus `GUARD_PAGES=1` (C CG CG C), so in series 2 the defaults and the home were not alternated with each other. That is why I give both gains: +15 % in series 1, +22 % in series 2. - The home took the card's time in compute dispatches from 35-40 ms to 18-19 ms a frame. Its pulls cost about 3.5 ms of card time a frame. - Against the port alone, it adds 3-8 ms a frame on the submitting thread, mostly in write-watch asking, refreshes and copies. - Texture loading was the same in the three configurations (about 27 thousand in the queue, 60-70 s to drain). - `GUARD_PAGES=1` adds nothing on top of the port and the home. With the port, there is far less left to copy. **Thread series** (0.8.3.5 + my fork, #572): - With the port and the home, the card is the limit for the typical frame, and the frames over 100 ms are those where the submitting thread prepares for too long. - With `VICTORY_THIN_THREADS=6` instead of 8, the frames over 100 ms fell from 18-23 % to 9-12 % (two runs each), with the same median. ## 5. Where the card still pays with the port and the home Same build, turning phase: the stock path with `GUARD_PAGES=1` against the port and the home. | card time a frame | stock + guard pages | port + home | |---|---|---| | the title's lists | ~33 ms | ~60 ms | | indirect draws | 13.3 | 26.5 | | dispatches | 9.2 | 18.9 | | indirect dispatches | 5.8 | 8.0 | | mesh | 3.4 | 5.6 | | our own lists | 4.3 | 1.1 | | indirect executions a frame | 6,360 | 7,770 | | card time per thousand executions | 5.2 ms | 7.8 ms | - At the same density, the port and the home still cost the card about 20 ms a frame more than the stock path. That is reads of the title's memory over PCIe, outside the home. - The ten programs with the most excess account for ~13 ms. The rest is spread out, about 1.4x per call in whatever reads the title's memory. - The largest single item is one culling program that writes ~2 MiB elsewhere in the buffer, scattered, over PCIe. - Several costly mesh programs bind the whole buffer and read other parts of it. ## 6. What I tried and dropped - **Pulling only the pages the CPU wrote (`HOME_SPARSE`).** - Windows' write watch only exists for private memory. - Under the port, the title's graphics pages are views of a section, because that's how the console's physical-page model is emulated. So the write watch has nothing to report for the ranges. - Making that memory private instead isn't possible without rewriting that memory model, because the title maps and unmaps those pages itself. - The code falls back to whole pulls by itself, with a warning. It would stay out of a PR. - **A separate copy queue for the pulls.** Each pull must see the previous submission's push already written. So the copy can only start when that submission ends on the card, and the next one waits for it: there's nothing to overlap. - **Widening the home to the ~2 MiB the culling writes.** - Dispatches fell ~4 ms a frame. - But the CPU also writes part of that range, so its pages come up in every pull, and pulls cost +1.9 ms. - Net: ~2 ms of card time a frame. The frame time stayed within the run-to-run spread, so I didn't keep it. - (Section 7: a learned pull now makes this range cheaper to keep in the home.) - **"Quiet" ranges:** adding ranges that the culling and the costliest mesh programs read, but pulling them only every 16th pull. - Objects flickered. - A counter of ours showed the title's memory in those ranges changing about 100 thousand dwords between full pulls. They are not quiet, and pulling them late means stale reads. - Dropped after one run. ## 7. What I'm testing now, and what is still open *Updated on 2026-12-04 with what the first two items gave. In short: each of them did what it was meant to do on the card or the threads, but on this PC the frame time varies between loads more than either effect, so I can't claim a frame-rate gain from them. All of this comes from short, quick tests in a controlled setting (the same spot and scripted camera turn as in section 4, about two minutes each, two runs per configuration), so please take it as a first look, not as settled results.* - **The lists' scratch buffers** (`VICTORY_SCRATCH_KEEP_MB=1024`). This is not the home, but it is on the same configuration. - The list translators wait for new buffers to become resident: about 26 ms a frame, summed over the threads. - On a 32 GB PC the spares are trimmed back to `VICTORY_SPARE_WARM_MB` every frame while the host is under memory pressure, so that key has to be raised too. - Result: with both keys, the waits went away. The typical frame looked slightly better and the long frames moved both ways, all within the run-to-run spread. I haven't put it in my launcher. - **A learned pull**, now in my fork, off by default. - The counted pulls, read back, tell which pages changed. Once that set stops growing, a pull copies only those pages, and every N-th pull stays whole and adds any new page. - Here the set stopped growing a few seconds after loading. A check run first, with whole pulls, found no page a learned pull would have missed after that. - With it on, the widened range from section 6 costs much less on the card. In short runs, one new page arrived late once, and nothing flickered. - I'm using it day to day to look for problems over longer sessions, not presenting it as a gain. - **CPU waits for the card in the title's copies inside card memory:** about 10 waits and 4.8 ms a frame. I haven't yet looked at which thread waits, or whether they can be deferred. - **The mesh programs that read the whole buffer:** the rest of the PCIe cost, ~5-7 ms. - They would have to be named for the home, and reads of 8 or 16 bits, typed reads and indexed reads are not redirected today. - High risk; I would measure it as a diagnostic first. - **A quick read of the code around the submitting thread (added on 2026-12-04).** While I couldn't run the game, I read the code and the logs I already had to see where the submitting thread waits. **This was a quick check, and part of it is my own reading of the code, not measured yet.** The proportions below come from a short timeline taken with a diagnostics build, which is slower than the normal one and adds its own cost to every call it records, so only the shares mean something, not the absolute times. All of these numbers come from my own PC (Ryzen 7 5700X, RTX 4070 SUPER, 3440x1440), so another machine may well give different results; seeing how each machine responds is exactly the point of sharing them. I'll test each point later with a key at a time, alternating runs, and post what holds and what doesn't. I left out what open or earlier PRs already studied. If anyone knows these paths better, corrections are very welcome. - **The submitting thread is idle about half the time** in that timeline, waiting for the next submission. What seems to cost is the waiting inside each submission, which delays the title's present and leaves the card waiting for the list, more than the total work. - **The write-watch asking** (about 11 ms a frame in my normal logs) is **~93 % waiting** for the thread that asks the kernel (`ask_first`): - about a third of that is `GetWriteWatch` itself, which here costs 3-4 times what the code's comment measured upstream (0.3 µs a call plus 0.5-1.1 µs per MiB walked). The calls that overlap a `VirtualProtect` on another thread cost 5-11 times that. My guess is that both take the same address-space lock in the kernel, but I haven't confirmed it. - In my normal logs the kernel walks ~400-450 thousand pages a frame to find ~2-3.5 thousand written ones. `VICTORY_ASK_NEAR=1` (512 KiB instead of 8 MiB) would walk far less; it has never been measured here. - **The guard faults cost the title's threads a lot** in that timeline: their `VirtualProtect` calls (opening a 64 KiB block) added up to 21-39 ms of thread time a frame, 0.3 ms each alone and 1.0-1.8 ms when a `GetWriteWatch` ran at the same time. To see what the normal build pays, I added a log line behind a new key that is off by default (`VICTORY_FAULT_TIME=1`, only in my local build for now): write faults per frame by the way they went, their time, and the `VirtualProtect` calls in faults, opening and guarding again. - **The copies' refreshes spend 27-42 % of their time waiting for the guards' lock** (`watch::guards`; my build has #527's journal mirror, so this isn't the journal's lock). The guards' lock is also taken by the title's streaming threads (`writing()` before a file read), the faults that go the locked way, `guard_ahead` and the runtime's memory notices, and guarding a block again (`VirtualProtect` in `guard_locked`) is done with it held. #434 already moves those calls outside the lock; its replay bench on a fast CPU saw no difference, so a slower CPU like this one may be where it shows. I'll first measure who holds the lock in the normal build (`VICTORY_GUARDS_TOP=1`, `VICTORY_REFRESH_TOP=1`) and then try #434 here. - **`VICTORY_GUARD_HOT=50`** (the launcher's value) leaves a block the title writes again and again open for 50 ms. `docs/findings.md` measured it in scenes of roughly 35-55 ms frames, so about one frame or a bit more. My frames are longer (about 70 ms), so 50 ms is less than one frame: if I read it right, a block written every frame is guarded again and faults again every frame. I'll try 150 ms. - **The waits for flights** are rare but long: about once every ten frames (sometimes less often) a small fill of upload memory waits for the flights to land, 15-20 ms each time. The code already has an option for this case, off by default (`VICTORY_FILL_TITLE=1`), with a stated risk (a constant read stale). I'll try it on its own and watch for visual faults. - None of this is a promise of a gain: the card itself is busy most of the frame here, so at best these points would reduce the time the card stands idle and the long frames. ## 8. What I don't know, and the risks - **One PC, one title.** On a PC whose card has no room to spare, the port loses badly (21.3 → 5.6 fps in tavochivix's 4K runs in #532). I don't know whether the home wins that back. - **The program list.** A program that writes the ranges without being translated for the home would read or leave stale data. That would most likely show as a visual fault, not a crash. The log names the programs that see the whole buffer without the home, so they can be checked. - **Descriptors made before the large buffer is first seen** stay on the title's memory. - **The conflict rule** ("the card wins on the same dword") follows from the merge. It has not caused anything I could see, but it is a rule, not a proof. - **Visual checks.** The visual faults I have seen in this title (late textures, some objects missing) happen with and without the home, and no new ones appeared with it. I have checked part of the game, not all of it. - **More long frames** than with `GUARD_PAGES=1`, as above. ## 9. What a PR would contain, and the questions A PR would contain only what is measured and kept: - the translator rule; - the host-side views; - pull and push with the merge; - the pushes inside lists; - arguments read from the copy; - the block-copy pull; - the log line; - tests; - off by default, and only with the port. It would leave out the sparse pull, the quiet ranges and everything from section 7. And it would carry **no values for any title**: - The culling programs are already named by the profile's `pass.*` roles. - The other programs would be a new role. An engine that doesn't know a role leaves it out with a line, so older engines still read such a profile. - The ranges would need a new profile entry. Unknown keys refuse the whole file, so a profile with that entry would be refused by older engines. My questions: 1. Would a PR like this be welcome? Or would you rather keep the port as it is, or solve the culling's atomics over PCIe another way? 2. If yes, where should the ranges come from? - A profile entry, with a format change or some other way you prefer so older engines aren't broken. - Or the engine finding them itself: under the port, it would note which pages of the shared buffer the culling programs reach with atomics, and keep those in the card's memory. That needs no profile values, but it is more work and more risk. 3. Profiles aren't distributed from this repository. If the values go into profiles, who would add them, so that others with a similar PC can test it? If the answer is no, that's fine: the home stays in my fork, and I'll keep posting what I measure. **Log:** not attached, because the logs carry the title profile's shader ids. I can post the summary lines (`frame times:`, `card profile`, `home (VICTORY_HOME) per frame`) from any of the runs above, with the game folder replaced by `<game>`. As in my other reports, I made the runs and the configuration, and a model (Claude) read the logs and helped with the code. Every number comes from the logs.
tillo88 commented 2026-12-04 06:12:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from readmet3xt-lab/foxhound. Originally posted by tillo88 on 2026-12-04T06:12:23Z.


@BrenoMazini, here is the port on/off measurement you asked for, on the replay bench.

Measured: release v0.8.3.5 (5e44415), no PR, VICTORY_PROFILE=1 on both sides; one side adds VICTORY_PORT_CONSTANTS=1. Same save and recorded controller input on every run, ~6.5 min route (prison cutscene, cut to the plane, first part on the boat); each job starts with a warm-up run that is not counted. 2 measured runs per side. VICTORY_PROFILE_TOP does not exist in v0.8.3.5, so there is no per-program breakdown (and I would not post program lines anyway, since they carry the profile's shader ids).

per frame (run 1 / run 2) port off PORT_CONSTANTS=1
fps 36.02 / 36.20 10.61 / 19.83
CPU prep, ms 18.23 / 17.44 9.71 / 10.24
submitting thread, ms 25.36 / 24.83 105.50 / 51.01
submitting thread waiting for the card, ms (median of the 5 s lines) 2.9 / 3.7 91.0 / 43.5
card busy, the layer's own estimate (median of the 5 s lines) 93 % / 94 % 100 % / 99 %
card profile: the title's lists, ms 11.16 / 10.52 22.26 / 17.37
card profile: indirect draws, ms 3.19 / 3.02 10.46 / 6.74
card profile: dispatches, ms 4.00 / 3.71 5.35 / 5.56
card profile: indirect dispatches, ms 2.62 / 2.51 3.89 / 2.80
card profile: our own lists, ms 0.48 / 0.45 0.07 / 0.11
median frame, ms 29.20 / 28.60 102.65 / 57.80
p95 / p99, ms 40.22 / 47.69, 40.27 / 46.94 120.51 / 124.89, 70.60 / 83.94
frames > 100 ms per run 17 / 16 1651 / 191

Card profile values are the frame-weighted means of the 5-second card profile lines over the whole route.

What it shows on this machine:

  • The port moves the limit to the card here too, and the frame rate falls a lot: from about 36 fps to 10.6 and 19.8 (the not-counted warm-up with the port was also at 19.8). CPU prep roughly halves, as on your PC, but the submitting thread then waits for the card for most of the frame.
  • Where the card's time goes differs from your report: on this route the largest rise is in indirect draws (about 3 ms to 6.7-10.5 ms), while dispatches rise only from about 3.9 to 5.4-5.6 ms. The title's lists go from about 11 to 17-22 ms of card time a frame.
  • The two port runs differ a lot (10.6 against 19.8 fps) and I can't explain that from the logs: same route, no crash, free RAM above 4.7 GB in both, no other job on the PC.
  • The port's log line reports one region of the title's graphics memory in place; once per run one title window is left as a copy (crates/victory-gpu/src/port.rs, "not one stretch of a section").
  • No crashes. One queue::behind warning ("a queue still stood at a wait at a present") in port run 2; the same one-time warning also appeared on this bench without the port, so I don't attribute it.

For scale: the release without VICTORY_PROFILE averages 36.86 fps over 9 runs (36.45-37.24) on the same route, so the profiler itself costs about 2 % here. A port-on job without the profiler is queued, to give the plain frame-rate cost.

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.

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

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7403187568 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/issues/586#issuecomment-7403187568). Originally posted by [tillo88](https://github.com/tillo88) on 2026-12-04T06:12:23Z. --- @BrenoMazini, here is the port on/off measurement you asked for, on the replay bench. Measured: release **v0.8.3.5** (`5e44415`), no PR, `VICTORY_PROFILE=1` on both sides; one side adds `VICTORY_PORT_CONSTANTS=1`. Same save and recorded controller input on every run, ~6.5 min route (prison cutscene, cut to the plane, first part on the boat); each job starts with a warm-up run that is not counted. 2 measured runs per side. `VICTORY_PROFILE_TOP` does not exist in v0.8.3.5, so there is no per-program breakdown (and I would not post program lines anyway, since they carry the profile's shader ids). | per frame (run 1 / run 2) | port off | `PORT_CONSTANTS=1` | |---|---|---| | fps | 36.02 / 36.20 | **10.61 / 19.83** | | CPU prep, ms | 18.23 / 17.44 | 9.71 / 10.24 | | submitting thread, ms | 25.36 / 24.83 | 105.50 / 51.01 | | submitting thread waiting for the card, ms (median of the 5 s lines) | 2.9 / 3.7 | 91.0 / 43.5 | | card busy, the layer's own estimate (median of the 5 s lines) | 93 % / 94 % | 100 % / 99 % | | card profile: the title's lists, ms | 11.16 / 10.52 | 22.26 / 17.37 | | card profile: indirect draws, ms | 3.19 / 3.02 | 10.46 / 6.74 | | card profile: dispatches, ms | 4.00 / 3.71 | 5.35 / 5.56 | | card profile: indirect dispatches, ms | 2.62 / 2.51 | 3.89 / 2.80 | | card profile: our own lists, ms | 0.48 / 0.45 | 0.07 / 0.11 | | median frame, ms | 29.20 / 28.60 | 102.65 / 57.80 | | p95 / p99, ms | 40.22 / 47.69, 40.27 / 46.94 | 120.51 / 124.89, 70.60 / 83.94 | | frames > 100 ms per run | 17 / 16 | 1651 / 191 | Card profile values are the frame-weighted means of the 5-second `card profile` lines over the whole route. What it shows on this machine: - **The port moves the limit to the card here too, and the frame rate falls a lot**: from about 36 fps to 10.6 and 19.8 (the not-counted warm-up with the port was also at 19.8). CPU prep roughly halves, as on your PC, but the submitting thread then waits for the card for most of the frame. - **Where the card's time goes differs from your report**: on this route the largest rise is in indirect draws (about 3 ms to 6.7-10.5 ms), while dispatches rise only from about 3.9 to 5.4-5.6 ms. The title's lists go from about 11 to 17-22 ms of card time a frame. - The two port runs differ a lot (10.6 against 19.8 fps) and I can't explain that from the logs: same route, no crash, free RAM above 4.7 GB in both, no other job on the PC. - The port's log line reports one region of the title's graphics memory in place; once per run one title window is left as a copy (`crates/victory-gpu/src/port.rs`, "not one stretch of a section"). - No crashes. One `queue::behind` warning ("a queue still stood at a wait at a present") in port run 2; the same one-time warning also appeared on this bench without the port, so I don't attribute it. For scale: the release without `VICTORY_PROFILE` averages 36.86 fps over 9 runs (36.45-37.24) on the same route, so the profiler itself costs about 2 % here. A port-on job without the profiler is queued, to give the plain frame-rate cost. 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. Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.
BrenoMazini commented 2026-12-04 11:26:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-04T11:26:06Z.


Thank you for taking the time to run this, and with so much care: a replay bench, a warm-up run left out, two measured runs on each side, and the profiler's own cost measured too. It is exactly the comparison I asked for, and more carefully done than mine.

Your result fits what I tried to describe in sections 8 and "How you can help", and I think it shows the other side of it well:

  • On your PC the card is already at 93-94 % busy on the stock path, and the CPU prepares a frame in about 18 ms. The CPU is not what holds the frame back, so moving work from the CPU to the card can only cost you, and it did.
  • On mine it is the opposite: on the stock path the card sits at around 56 % busy and the submitting thread is the limit. That is the only case where the port, and the home on top of it, can pay: a CPU that limits the frame, and a card with room to spare.

Your numbers also show something I didn't know. On your route the largest rise is in indirect draws, while dispatches rise only by about 1.5 ms. Here the rise was mostly in dispatches, from the culling's atomics over PCIe, which is the only cost the home removes. So even where the port does pay, how much the home can win back may depend a lot on the scene.

To be clear, I'm not presenting any of this as confirmed. Everything on my side comes from one PC and short runs, and the frame times vary between loads more than I would like (your two port runs, 10.6 and 19.8 fps, show the same kind of spread). It still needs tests from people with hardware like mine, or with the same pattern: a CPU that limits the frame while the card has room left on the stock path.

One difference between our setups that may matter: my runs are made further into the story, in a city area with many more people and objects around. It is a much denser scene, about 5,500-7,500 indirect executions a frame in my logs, and that is where the CPU limit shows most. Your automated route is very good, because it can be repeated exactly. If at some point you could also record one through a city area like that, I think it would be the most useful comparison, since that is probably where most players spend their time. The indirect executions per frame value from the 5-second lines would also let us compare the density of our scenes directly. There's no hurry at all.

Thanks again for the help.

As in my other posts, I made the runs and wrote the request, and a model (Claude) helped me read the logs and write this reply.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7410090880 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/issues/586#issuecomment-7410090880). Originally posted by [BrenoMazini](https://github.com/BrenoMazini) on 2026-12-04T11:26:06Z. --- Thank you for taking the time to run this, and with so much care: a replay bench, a warm-up run left out, two measured runs on each side, and the profiler's own cost measured too. It is exactly the comparison I asked for, and more carefully done than mine. Your result fits what I tried to describe in sections 8 and "How you can help", and I think it shows the other side of it well: - On your PC the card is already at 93-94 % busy on the stock path, and the CPU prepares a frame in about 18 ms. The CPU is not what holds the frame back, so moving work from the CPU to the card can only cost you, and it did. - On mine it is the opposite: on the stock path the card sits at around 56 % busy and the submitting thread is the limit. That is the only case where the port, and the home on top of it, can pay: a CPU that limits the frame, and a card with room to spare. Your numbers also show something I didn't know. On your route the largest rise is in indirect draws, while dispatches rise only by about 1.5 ms. Here the rise was mostly in dispatches, from the culling's atomics over PCIe, which is the only cost the home removes. So even where the port does pay, how much the home can win back may depend a lot on the scene. To be clear, I'm not presenting any of this as confirmed. Everything on my side comes from one PC and short runs, and the frame times vary between loads more than I would like (your two port runs, 10.6 and 19.8 fps, show the same kind of spread). It still needs tests from people with hardware like mine, or with the same pattern: a CPU that limits the frame while the card has room left on the stock path. One difference between our setups that may matter: my runs are made further into the story, in a city area with many more people and objects around. It is a much denser scene, about 5,500-7,500 indirect executions a frame in my logs, and that is where the CPU limit shows most. Your automated route is very good, because it can be repeated exactly. If at some point you could also record one through a city area like that, I think it would be the most useful comparison, since that is probably where most players spend their time. The `indirect executions per frame` value from the 5-second lines would also let us compare the density of our scenes directly. There's no hurry at all. Thanks again for the help. As in my other posts, I made the runs and wrote the request, and a model (Claude) helped me read the logs and write this reply.
Sign in to join this conversation.
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#586
No description provided.