RTX 4070 SUPER, Ryzen 7 5700X: what limits the frame, VICTORY_PORT_CONSTANTS on a CPU-bound PC, and what did not help #532
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-03T02:57:36Z.
foxhound version: builds of my fork on v0.8.2 to v0.8.3.3 (main
7dbcdcb), release, withVICTORY_PROFILEfor the card's timesGPU / CPU / RAM / Windows: GeForce RTX 4070 SUPER 12 GB (driver 621.24, PCIe Gen4 x16) / Ryzen 7 5700X (8 cores, 16 threads, one CCD) / 32 GB / Windows 11, build 26300
Launcher settings (resolution, DLSS, Frame Generation, VRAM limit): 3440x1440, Series X profile, DLSS Performance, no Frame Generation, no VRAM limit (the layer planned with 11,229 MB)
What happens, and when:
Slow frames in heavy scenes (14-18 fps), on a PC that is CPU-bound with the default switches. This is a report of measurements and three questions rather than one fault. The fixes found along the way are their own PRs: #525 (decoration bakes), #527 (journal reads without the lock, with
VICTORY_REFRESH_TOPandVICTORY_GUARDS_TOP) and #531 (Quit and Restart from the launcher). If it helps, I can open this as a file indocs/instead.This is AI-assisted (Claude): the runs were played by hand, and a model read the logs. Every number below comes from the frame lines or the diagnostics of those logs.
The runs are free play, not replays. Draws per frame differ from run to run (about 5,000 to 7,500 indirect executions in the heavy scenes), so read differences under about 10 % between runs as nothing. Where two runs are compared, they used the same build, in the same part of the game, and differed only in the switch named.
Result
With
VICTORY_PORT_CONSTANTS=1and my fork'sVICTORY_HOME=1(see below):With the default switches this PC is CPU-bound: in a heavy scene the card was 50-60 % busy while the submitting thread prepared. With
GUARD_PAGES=1added to the defaults (4 KiB guard pages), the frame rate rose by about 10 % (12.4 → 13.7 fps in the controlled runs).VICTORY_PORT_CONSTANTS=1here: the limit moves to the card, the frame rate staysThe README says the port is slower overall on a 12 GB card. Here, in controlled runs (two of each, in alternating order, from the same spot along a scripted camera path), while turning the camera:
VICTORY_PORT_CONSTANTS=1The port moves the limit from the processor to the card, and the card then holds the frame where the processor did: no gain on this PC either. The first version of this report showed 13.0 → 17.8 fps from one pair of free-play runs; those runs were not comparable, and that figure is withdrawn.
Where the port's extra card time goes
About 40 ms more of card time a frame in the controlled runs. Most of it is in the dispatches (8.5 to 40.3 ms), led by the title's culling compute programs.
Why the buffer cannot simply live on the card
memcpy/memsetand its own code, every frame.A limit of the architecture: no write watch in the port's memory
xmememulates with one section mapped into placeholders.MEM_WRITE_WATCHon private memory.GetWriteWatchfails on those views.Where the submitting thread goes (heavy scene, port and
VICTORY_HOMEon)Sample of a 56.8 ms frame, 6,074 indirect executions:
JOURNALlock is not the critical path. Reading the journal without its lock (#527) made its reads nearly free and cut noting from 4.8-7.3 ms to 1.7 ms a frame, summed over threads. The submitting thread's mean stayed at 53 ms.VICTORY_GUARDS_TOP, in #527) costs the submitting thread 4-6 ms a frame.kernel_writing), about 33 ms a frame summed.Where the spikes come from
In light scenes the game holds 30 fps; these were the frames over 100 ms and twice the median:
The culling's atomics kept on the card (my fork's
VICTORY_HOME)What it is. With the port, the title's large shared buffer lives in the PC's memory, and the culling programs do their atomics on it over PCIe. The home gives the few MiB those programs touch a second copy in the card's memory. The culling programs are translated to use that copy, and a small program of ours syncs it with the PC's copy before and after each submission that uses it.
Why it is not a PR. It has to know which ranges of that buffer to move and which programs to translate. Both come from my own measurements of this title: its memory layout and the hashes of its programs. The project doesn't ship title-specific data. A PR would have to find both at run time instead, and it would only help where the port itself is worth turning on, which the runs show is not most PCs.
It stays in the fork: its ranges come from the title, and it only applies with the port. (The first version of this report listed it under "Measured and not worth it", from free-play runs.)
Measured and not worth it
ExecuteIndirectarguments read from the card's copy: same cost per command (3.10 against 3.22 µs per indirect draw). Reading the arguments over PCIe was not the cost.ExecuteIndirectabout 40 times a frame, so the mirror is reloaded about 43 times a frame. That is more PCIe than the culling costs.D3D12_HEAP_TYPE_GPU_UPLOADheap mapped by tiles over a reserved buffer, an experiment of another layer on this PC: Windows froze for two hours and needed a forced reset. Do not tile-map GPU_UPLOAD heaps.Questions
Has anyone measuredWithdrawn: in controlled runs the port alone gives no gain here, and on another PC with less card headroom it loses outright.VICTORY_PORT_CONSTANTS=1on another CPU-bound PC? Here it gives +4-5 fps. Should the README's note say it depends on which of the two is the limit?Log: the numbers above are quoted from my logs; I can attach one, with the game folder replaced, if it helps.
Imported from readmet3xt-lab/foxhound. Originally posted by tavochivix on 2026-12-03T11:49:08Z.
Here are results from another machine, a Ryzen 5 5600X and RTX 5070 Ti. These runs used the Series X settings, 3840×2160 output, the game's upscaler, and frame generation off. The scene and upscaler differ from the free-play report. We tested the public memory options with no
VICTORY_HOMEchanges.CPU versus GPU limits. On public commit
7dbcdcb, enablingVICTORY_PORT_CONSTANTSin the opening sequence cut median buffer refresh time from 16.7 to 9.3 ms/frame. The median wait for the GPU rose from 0.5 to 123.8 ms/frame, and rendered FPS fell from 21.3 to 5.6. Together with the 13.0 → 17.8 FPS you measured, this supports describing both costs in the README.A setting worth testing on the 4070 SUPER. On a local release build, we ran all four combinations twice from the same save and renderer cache, in reverse order on the second pass. Each run measured the same 60-second opening sequence. The table pools frames and elapsed time across both runs.
PORT_CONSTANTS=1)Pairing opening-sequence intervals by scene time and draw count and excluding pipeline activity gave the same pattern. With the port off, finer tracking improved FPS by 16.3% and 12.4% across the two passes. With the port on, the changes were +0.55% and −0.36%.
On the CPU-heavy bridge, in 24 intervals matched on scene time, draw count and dropped calls with no observed pipeline activity, finer tracking reduced refresh copies from 108.2 to 28.6 MiB/frame and raised FPS from 15.13 to 17.22. Only one default-tracking run stayed in the dense scene. A separate run that alternated tracking modes also favored finer tracking (15.29 → 16.62 FPS). To try this comparison on the original machine, leave
PORT_CONSTANTSoff and enterGUARD_PAGES=1under Further switches in the launcher.Separately, the local build skips redundant texture-preparation work by default. With the memory settings held fixed, enabling those changes raised rendered FPS from 17.04 to 17.67 in 28 matched intervals in the dense opening. The full-minute averages were slightly lower in both pairs (21.37 → 21.32 and 21.85 → 21.47).
What we saw in the culling data. Two captured shaders reserve list entries with atomic adds. Later indirect commands in the same list consume the exact counter words as a draw's instance count and a dispatch's X group count. The three compute shaders we timed slowing down in the opening sequence contained no atomics. The four costly shaders in your report remain unidentified here.
The 64 KiB unit is the mapping granularity. The CPU and GPU can address words within each page. Ten CPU copies reached the page containing one draw counter and stopped short of its four bytes. A separate append counter and its list were outside the shared heap. Keeping a particular counter in VRAM would require accounting for any CPU readers and writers of those bytes and their ordering.
Follow-up on unmodified public
main(7dbcdcb). We repeated the guard-page comparison on this same 5600X/5070 Ti using the public code, with the constants port off. Four runs used the same save and renderer cache, in default / 4 KiB / 4 KiB / default order. In the 60-second opening sequence, the two pairs went from 22.49 to 25.05 FPS and from 22.28 to 25.07 FPS. Across the two runs per setting that is 22.39 → 25.06 FPS (+11.9%). Median refresh copies fell from 60.6 to 17.1 and from 59.7 to 18.3 MiB/frame. Matching intervals on scene time and draw count and excluding logged pipeline activity still gave gains of 9.6% and 13.6%. This comparison used the existing launcher switch and does not require the local texture changes.Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-03T12:50:48Z.
Thank you for the careful runs, and for the 4 KiB tracking comparison.
A heads-up before anyone builds on my numbers: I'm redoing my measurements under tighter control, and some of what the report says will change. In particular, the 13.0 → 17.8 fps for
VICTORY_PORT_CONSTANTS=1does not hold up so far. In a controlled run, with the configurations alternated, the port alone gives about the same frame rate as the defaults here. It moves the limit from the processor to the card, which matches what you saw.I'll post the corrected numbers in this issue once the runs are done, including
GUARD_PAGES=1with the port off as you suggested. With the defaults my copies of changed buffers are about 105 MB a frame, close to the 108 MiB in your CPU-heavy scene, so I expect it to matter here too. A new PR with further adjustments will probably follow.Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-03T14:08:03Z.
Controlled runs: the constants port, 4 KiB guard pages and the home. This corrects the section on the port.
As promised above, I redid the measurements under control: 14 runs in two series, in alternating order, with the same spot, the same scripted camera path and the same build.
In short
VICTORY_PORT_CONSTANTS=1alone does not raise the frame rate on this PC. It gives 12.7 fps against 12.8 with the defaults. The +4-5 fps in the report came from two runs that were not comparable. I withdraw it, and question 1 with it: the README's caution holds here too. The port moves the limit from the processor to the card (56 % → 99 % busy), and the card then holds the frame where the processor did.GUARD_PAGES=1with the port off is the clean gain: +10.5 % (12.4 → 13.7 fps). The copies of changed buffers fall from 140 to 52 MB a frame. No run of one setting overlaps the other. This matches @tavochivix's +11.9 % on a Ryzen 5 5600X with an RTX 5070 Ti, so the gain shows on two machines.VICTORY_HOMEis the fastest here: 15.1 fps against 12.4 with the defaults on the same day (+22 %). In the report I listed the home under "Measured and not worth it". Its copy-ins have become cheaper since, and it now pays. It still stays in the fork (see below).GUARD_PAGES=1adds nothing on top of the port and the home (15.1 against 15.1 fps). There the card is the limit, and with the port there is far less left to copy. This also matches what @tavochivix saw with the port on.GUARD_PAGES=1How it was measured
7dbcdcbwith #525, #527 and the home). The 4 KiB guard-page code is main's; around it my build adds only #527's lock-free journal reads.VICTORY_PROFILE=1andVICTORY_PROFILE_TOP=1(the card's time by kind and by program),VICTORY_BAKE_PASS_MS=0, andVICTORY_KEYS_FILEfor the input. Only the switches named below differ between configurations.PORT_CONSTANTS=1PORT_CONSTANTS=1,HOME=1GUARD_PAGES=1PORT_CONSTANTS=1,HOME=1,GUARD_PAGES=1VICTORY_KEYS_FILE, with no hand on mouse or keyboard:Series 1, turning: defaults, port, port + home
Series 2, turning: the 4 KiB guard pages with and without the port and home
GUARD_PAGES=1GUARD_PAGES=1What the runs show
The port.
The 4 KiB guard pages, port off.
The guard pages with the port and the home.
The home.
I saw no visual faults in the AG and CG runs: no flicker, broken faces or missing objects.
On the report's questions
The report's result for the port with the home (14-18 fps in heavy scenes) still stands: these runs gave 14.3-15.6 while turning.
A question for the maintainers: on two machines
GUARD_PAGES=1gives 10-12 % with the port off, and nothing with it on. Would a PR that turns it on from the launcher be welcome, asSTORE_BESIDEis now? Or should it stay a documented switch, as #560 proposes? (I've asked in #560 to drop the 13.0 → 17.8 sentence.)I can attach the logs of these runs, with the game folder replaced by
<game>, if that helps.Imported from readmet3xt-lab/foxhound. Originally posted by nativ69 on 2026-12-03T23:41:24Z.
Thanks for the detailed investigation and the controlled follow-up runs. Since my hardware is very similar to yours, I ran nine tests on v0.8.3.5 to investigate
VICTORY_GUARD_PAGESfurther, including itsMOSTandHOT_MStuning parameters.I reproduced the substantial reduction in buffer refresh copies, although the FPS improvement was smaller and less consistent on my system. Reducing the page threshold from 8 to 4 appears to offer a useful balance.
System specifications
Test configuration
5e44415b4663), release buildVICTORY_STREAMLINE_PRESENT=1VICTORY_ASYNC_SUBMIT=1VICTORY_TEXTURE_STAGE_MS=16VICTORY_THIN_THREADS=8VICTORY_PORT_CONSTANTS=0The tests were played manually through the opening sequence, including cutscenes and gameplay. I collected runtime logs and Windows performance counters at approximately one-second intervals and used AI-assisted analysis of the logs. These are not scripted, scene-matched benchmarks. The workload and memory pressure vary between runs, so small FPS differences should be treated cautiously.
For the performance tables, I selected reporting windows with at least 0.9 DLSS upscalings per frame to focus on active rendering. Average FPS is total measured frames divided by the sum of the selected window durations. Frame-time percentiles and per-frame timing counters are medians of reporting windows, not global frame-time percentiles. Copy volumes are frame-weighted means. Windows memory and CPU statistics cover the continuous interval from the start of the first selected window to the end of the last.
1. Test matrix and performance
Tests are listed in chronological order.
2. Buffer refresh and submission costs
Refresh copies refer specifically to bytes copied by write-watch/guard-based buffer refreshes, in the log's reported MB units, not total memory traffic. Single-page openings count write faults that opened an individual 4 KiB page, not all write faults. Whole-block openings include both threshold-triggered and hot-block openings. CPU usage is system-wide.
GPU queue busy is Foxhound's internal estimate, not hardware GPU utilization. During gameplay, Task Manager generally showed around 90% GPU utilization on my system. I did not capture independent GPU utilization counters in these runs.
3. System memory pressure
The lower copy volume does not necessarily translate into a smaller memory footprint. Memory pressure remained substantial throughout the tests. Pages Input/sec also includes memory-mapped file activity, so it should not be interpreted as pagefile-only I/O.
4. Effect of the guard-page threshold
With
HOT_MS=0:For configurations tested twice, the summary uses the arithmetic mean of the two run-level results rather than pooling the runs.
MOSTfrom 8 to 4 reduced single-page openings by approximately 43%, without increasing copy volume. Both runs withMOST=4reproduced this pattern.MOST=4reduced copy volume by approximately 45%. Average FPS was about 4.8% higher, but the uncontrolled workload means this is not a confirmed FPS gain.MOSTfurther to 2 reduced single-page openings again, but the measured FPS was lower and copy volume increased slightly. That run also experienced greater memory pressure.5. Effect of hot-block tracking
Keeping
MOST=4:Increasing
HOT_MStrades fewer individual page openings for more bytes copied. At 500 ms, the copy volume was already close to the disabled Guard Pages baseline. At 50 ms, the reduction in single-page openings was small, with higher copy volume and preparation time.The 100 ms run had the highest average FPS, but both the 100 and 500 ms runs contained unusually long frames. I cannot attribute those stalls to hot-block tracking itself. The exact configured
HOT_MSvalue is not printed in the logs; the values above are the requested launch settings.Recommendation
For my system, I would currently use:
I would leave
VICTORY_GUARD_PAGES_HOT_MSat its disabled default (0), and keepVICTORY_PORT_CONSTANTS=0.The most compelling result here is the reproducible reduction in buffer refresh traffic and single-page openings, rather than the small differences in FPS. Given the results in this issue and the additional measurements above, I think Guard Pages with
MOST=4is worth considering as a launcher option or documented recommendation. I would still validate the threshold on other systems with controlled, scene-matched runs before changing the global default.Imported from readmet3xt-lab/foxhound. Originally posted by tillo88 on 2026-12-04T00:47:08Z.
Another data point for
VICTORY_GUARD_PAGES=1, on a faster CPU (replay bench, constants port off)Measured: release v0.8.3.5 (
5e44415) with default switches, against the same release withVICTORY_GUARD_PAGES=1added (GUARD_PAGES_MOSTandGUARD_PAGES_HOT_MSnot set,PORT_CONSTANTSoff). 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. 5 release runs, 4GUARD_PAGES=1runs (two separate jobs).GUARD_PAGES=1(4 runs)What it shows on this machine:
GUARD_PAGES=1run below every release run, while asking the write watch rises by about 0.9 ms: the same direction as the runs above on the 5700X, 5600X and 5800X.So on a CPU where prep is not the whole frame, the gain is small and comes with somewhat more long frames on this route.
VICTORY_GUARD_PAGES=1withVICTORY_GUARD_PAGES_MOST=4, as suggested above, is queued on the same bench.Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default
play-foxhound.ps1settings (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.
Imported from readmet3xt-lab/foxhound. Originally posted by BrenoMazini on 2026-12-04T01:02:55Z.
Thank you for running this on a much faster CPU, and for how carefully the bench is set up: a warm-up run, several runs per setting, and the ranges along with the means. It fills a gap I couldn't fill from here.
If I read it right, it shows the other side of what I measured. On the 5700X, the submitting thread's preparing is most of the frame, so the ~9.5 ms that guard pages took off it showed up in the frame rate (+10.5 %), and the p95 went down too (96 → 86 ms). On your 9800X3D, preparing is about 19 of 28 ms, so the same direction in prep (−2.4 ms) gives only +1.9 %, and the long frames went the other way. I can't tell from here why they rose on your route. I haven't seen that on mine, but my runs are a 24 s camera turn in one spot, not a 6.5 min route with cutscenes, so I may simply not be catching it.
That changes how I see the question I asked above, about turning it on from the launcher. With your numbers, a default for everyone looks wrong to me. An option, or a recommendation for CPUs where preparing is most of the frame, seems closer to what the data shows. I'd leave that to you and the maintainers.
On
GUARD_PAGES_MOST=4: I've prepared a controlled series on the 5700X, 8 translators, the default 8 against 4, alternated, with the system's commit and free RAM logged in each phase. I'll post it here when it's done, so it sits next to yours and nativ69's.One more thing, only if you have the time and it interests you. I've opened #586 with everything I have on my fork's "home", which makes
VICTORY_PORT_CONSTANTS=1pay on a CPU-bound PC. It has a "How you can help" section, and the first item there is exactly what your bench does well: the port on against off, same route, with the card profile's dispatch time and the submitting thread's preparing. Your PC is probably not one where the home would pay, but a clean measurement of what the port costs the card on a 5070 Ti would still tell me a lot. Any correction to what I wrote there would be just as welcome.Imported from readmet3xt-lab/foxhound. Originally posted by tillo88 on 2026-12-04T03:40:54Z.
Follow-up:
VICTORY_GUARD_PAGES_MOST=4on the same replay bench (9800X3D)As announced above,
VICTORY_GUARD_PAGES=1withVICTORY_GUARD_PAGES_MOST=4(the setting @nativ69 suggested), on release v0.8.3.5 (5e44415), constants port off,GUARD_PAGES_HOT_MSnot set: 2 measured runs (after a warm-up run that is not counted). The release baseline now has 7 runs, so its figures differ slightly from my comment above.GUARD_PAGES=1, MOST default (4 runs)GUARD_PAGES=1,MOST=4(2 runs)What it shows on this machine:
MOST=4behaves like the default threshold here. CPU prep, write-watch asking and the GPU time the layer reports are the same as with the default within run-to-run spread; prep is about 2.2 ms below the release in both runs.MOST=4reduces the long frames.This bench does not log the single-page openings per frame, so it cannot show the drop in openings @nativ69 saw. On a CPU where prep is about two thirds of the frame, the threshold does not move the result either way.
@BrenoMazini: the port on/off measurement you asked for in #586 (with
VICTORY_PROFILE=1on both sides) is queued on this bench; I'll post it there.Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default
play-foxhound.ps1settings (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.