Triforce v0.8.5

A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-28 10:54:41 -06:00
parent 2df08c751e
commit b527e29adb
203 changed files with 18821 additions and 2051 deletions

View File

@@ -103,6 +103,7 @@ screen. It costs some GPU time on cards that cull quickly, so it is off unless s
| `HOS_AUDIO=0` | No sound device is opened (the mixer still runs); `scripts/run-vk.ps1` sets it unless `-Sound` |
| `HOS_AUDIO_AUX=0` | (Triforce, 11-24) The game's Aux effects are accepted and passed through, as before: the mix they are on plays as it came. The default runs them: each 5 ms frame the mix's sent buffers go to the game's own effect code as whole frames (`ReadAuxSendBuffer`) and what it hands back (`WriteAuxReturnBuffer`) takes their place, silence when it has handed nothing back in time. Passed through, an effect's send was heard as one more dry source and the effect itself never. `HOS_AUDIO_EFFECTS=0` leaves them out too (`host/nn_audio.c` "Aux", `tests/test_audio_aux.py`) |
| `HOS_AUDIO_EFFECTS=0` | The game's plain reverb, delay and biquad filter effects on its mixes and its splitter destinations' biquad filters are accepted and left out, as before they were emulated (the sound unfiltered and at full level: the "Volcano eruption audio bugged" ticket); the I3DL2 reverb still runs. By default they run on the mix buffers in the order the game added them (`host/nn_audio.c` "mix effects"; `tests/test_audio_mix_effects.py`) |
| `HOS_MENU_SOUND_SETTINGS_NAVIGATE=<sound>`, `HOS_MENU_SOUND_SETTINGS_SELECT`, `HOS_MENU_SOUND_SETTINGS_BACK`, `HOS_MENU_SOUND_MODS_NAVIGATE`, `HOS_MENU_SOUND_MODS_SELECT`, `HOS_MENU_SOUND_MODS_BACK`, `HOS_MENU_SOUND_PAUSE_BACK`, `HOS_MENU_SOUND_SETTINGS_ON`, `HOS_MENU_SOUND_SETTINGS_OFF` | (Triforce, 11-25) Another of the game's interface sounds for one of the settings' own: moving, choosing and going back on the Triforce settings tabs and on the Mods screen, and the step back to the pause menu's System list (out of the Mods screen opened from it, and Cancel or B on Quit's dialog). The value is a sound's bare name, the file `Sound/Resource/Stream/<sound>.bwav` of the game's files without its folder and `.bwav`: `HOS_MENU_SOUND_SETTINGS_NAVIGATE=SE_Sys_Cursor00` is the in-game menu's tick again. Letters, digits and `_` only, 64 at most; any other value is left out, and a name the game's files do not have (or a file that is not a sound) leaves that one its own sound, each with a `menu sounds:` line in the log, as has every one that is set. Not set, they are the system menu's (the title screen's): `SE_Sys_SysMenu_Cursor00` for the two Navigate, `SE_Sys_SysMenu_DecideL00` for the settings' Select (the title's Continue's) and `SE_Sys_SysMenu_DecideS00` for the Mods screen's, `SE_Sys_SysMenu_Cansel00` for the three Back, and for a toggle switched On (`SETTINGS_ON`) the small decide, Off (`SETTINGS_OFF`) the cancel (in 0.8.3 and before, the in-game menu's `SE_Sys_Cursor00`, `SE_Sys_Do00` and `SE_Sys_Cancel00`). Read once, when the sounds are; `triforce_env.txt` takes them (`host/menu_sound.c` `roles`, `gpu/vk/menu_sound_events.h` `sound_for`; `tests/test_menu_sound_roles.py`) |
| `HOS_LANGUAGE=<code>` | The game's language for this run, a code from `language.txt` |
| `HOS_OUTPUT_RES=<0..8>`, `HOS_OUTPUT_SIZE=<w>x<h>`, `HOS_HANDHELD=1`, `HOS_ASPECT=<ratio>` | Over the options file: the output resolution (as `output_res` below), Custom's size (as `output_width` and `output_height`), the handheld profile, and the picture's shape whatever the Output resolution and the Ultrawide row say (a ratio, width over height: 2.3889 is 3440x1440's; the picture is the output's height in that shape, kept to 3840x2160's pixels). The Insert menu shows `HOS_OUTPUT_SIZE` and `HOS_ASPECT` in the rows they set, which then have nothing to choose |
| `HOS_WIDE_UI=0\|1`, `HOS_WIDE_UI_LOG=<n>`, `HOS_HUD_MAX_RATIO=<ratio>` | (Triforce) The HUD's layout on a picture wider than 16:9 (`host/hos_wide_ui.c`, ozwaldorf's pane planner): with the Display tab's HUD position at Screen edges the HUD's side panes move out to the screen's edges, planned at each present from the panes as the game places them (`nx2/oot_wide.py` `UI_SITES`), so the row changes at once; with Menu sides at Extended the menus' side panes too. Middle, the default, plans nothing. Not on a picture narrower than 16:9. `HOS_WIDE_UI=0`: off, and Screen edges moves the HUD's panes as the layouts load (`host/prompts.c` `build_layouts`), as before; `=1`: Screen edges whatever the row. `HOS_WIDE_UI_LOG=<n>` logs the first n changes of the plan, each root layout and the plan's time; `HOS_HUD_MAX_RATIO` (12:5 by default, 0 none) is the widest the HUD's sides go |
@@ -137,6 +138,7 @@ screen. It costs some GPU time on cards that cull quickly, so it is off unless s
| `HOS_GUEST_MEMFD=0`, `=1` | (Linux) The guest window as a memfd's, its pages handed to the GPU as dma-bufs (udmabuf), where `/dev/udmabuf` can be opened: amdgpu checks every page of a host-pointer import again at each submission, 15-45 ms a submission in Kokiri. (Triforce, 11-21) Also where udmabuf's `size_limit_mb` cannot be read (Flatpak and other sandboxes hide `/sys/module`): its default, 64 MB, is assumed and the log says so; only a limit that reads 0 keeps the window anonymous. The log's `mem: the guest window is a memfd's` line. `=0`: anonymous memory, host-pointer imports; `=1`: the memfd all the same |
| `HOS_MEM_TRACE=1` | (Triforce, lab) Logs every address region and page call of the game with its size and caller (`memtrace:` lines; a region's with its call stack) and every `QueryMemoryInfo` answer |
| `RX_VK_WB_EXCL_CLIP=0` | (Triforce, 11-22; on by default with `RX_VK_CAP_ONLY_GPU=1`) A written binding is copied back to guest memory whole at the submission's end, as in 0.6.0. By default the parts of it in memory the capture leaves out (heap memory between the game's pools inside an imported chunk) are not: the collection does not stamp the CPU's writes there, so the mirror's bytes there are stale, and the write-back diff copied them over the game's newer ones. A pointer table's bare entry (its 64-byte head marked written, `gpu/vk/vk_draw.cpp`) did so over a heap block 0x18 past its base: the 0.6.0 crashes at area changes in guest 0x803b44e0 (a block header of 0x9ed00000001 or 0x1aa88000013fe), 0x80a30a00 and 0x80a31030 (`gpu/vk/wb_excl_clip.h`, `gpu/vk/vk_memory.cpp` `gpu_buffer_bind`; `tests/test_wb_excl_clip.py`). The first 20 clipped write-backs are logged (`vk: write-back of ... not copied back`) |
| `RX_VK_CAP_EXCL_GAP=0`, `=check` | (Triforce, 11-26, the GPU audit's C09; on by default with `RX_VK_CAP_ONLY_GPU=1` or `2`) `=0`: the check that counts the replay's reads, texture uploads and buffer bindings reaching into memory the capture leaves out (`cap_excl_note`) searches the left-out ranges at every question, as before. By default a thread keeps the last 8 gaps between left-out ranges its searches found and answers a question wholly inside one of them without a search; a question across a gap's edge is searched, and the gaps are dropped whenever the ranges change (`gpu/vk/capgap.h`, `gpu/vk/vk_memory.cpp` `cap_excl_hit_gap`; `tests/test_capgap.py`). Why: the search ran first thing in every `gpu_buffer_bind` over 2,400-3,650 ranges on the lab PC, 2.3% of the Presentation Thread's own time at Lake Hylia and 2.6% in the Market, for a count that is nearly always not raised; about 0.1 ms a frame expected at Lake Hylia, measured on v0.8.4 at the end of this row. The same answers and the same count; the write-back's clip (`RX_VK_WB_EXCL_CLIP`) and `RX_VK_CAP_ONLY_GPU=2`'s page count keep the plain search. `=check`: both at every question, the search's answer used and the differences counted and the first 20 logged. Any other value: the memo, as unset, and logged. The lab's knob `nocapgap` (`RX_VK_LAB_AB`) is `=0` in its phases (a thread asks it again only when the phase moves, not at every question). The log's `capture (RX_VK_CAP_ONLY_GPU` line every 10 s carries `left-out checks in all from the gap memo N, searched M, differing D (RX_VK_CAP_EXCL_GAP)` (totals since the start; N and M count only the memo's questions, none with `=0` or in `nocapgap`'s phases, and up to 255 a thread are not yet added; D is 0 unless `=check` finds a difference). Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.121 ± 0.051 ms a frame (1.6% fps), measured while the knobs `nocapgap` and `nobindspan` were still asked at every left-out check and every binding that may use a span, string compares that every knob's phases paid and the phases without a knob did not, so the figure is likely somewhat high (by an estimated 0.03-0.09 ms). The check run (all four scenes, every rider checked at once): 82,900,725 left-out checks answered from the memo, 0 differing |
| `HOS_FPS_STEADY=0`, `=1`, `=2` | (Triforce, off by default: the Frame pacing row's two Steady values, over them) 1 any rate, 2 steps of the display's refresh: the game's frames paced to a period this PC holds in the scene, never shorter than the Game frame rate cap's (`host/pace_steady.h`, `host/nn_vi.c` `steady_period`). The rate is chosen by probes (`pace_steady_probed`): 32 frames at the cap, unpaced, the last 24 of them measured, at the start, 2 s after a load, at least every 12 s, and when a quarter of the last 64 frames ran late (2 s after the last probe at the soonest, twice that each time a probe changes nothing, up to 12 s); the rate becomes the first the last three probes' 90th percentile fits in with 2% to spare where that is slower, or the first it fits in with 5% to spare where that is faster. A frame paced slower does more work (the lab's Market: 11.6 ms unpaced, 15.5 ms paced at 55 fps), so the frames' own measure as they run chased the rate down; frames late now only bring a probe on, and the rate is never under what a probe shows the PC holds. `HOS_FPS_STEADY_PROBE=0`: no probes, the rule below as before. Without probes: what a frame took is its present interval less the longest of the pacing's waits in it (the acquire's, on the presenting thread or another, and the present's hold), and what it needed the interval less all of them (OoT's main thread and Presentation Thread take turns; where the waits add up to the whole interval, the longest: `pace_steady_measure`); a quarter of the last 64 frames that took more than the period lowers it at once to the first rate their 90th percentile fits in with 2% to spare, and once it has held 3 s since a raise (6 s since a lowering, doubled for each lowering within 30 s of a raise, up to 120 s, and back to 6 s at a load) it rises to the fastest rate the 90th percentile of what the last 512 frames needed fits in with 5% to spare (one rate at a time where the game acquires on another thread). A frame that took over 2.5 times the median of the last 64 (hitches among them), a present interval over 250 ms, and the frames of the 2 s after such a load (the scene is not its measure yet) are left out; the first lowering after a load waits for 128 frames of the new scene and takes their 90th percentile. The acquire's wait starts the frames a period apart (the steady step then gives the game the period as its time step) and the present holds each picture of the game's to the period after the last, less a 64th of it (`gpu/vk/present_smooth.h` `present_smooth_paced_at`, with or without the Frame pacing row; not with frame generation). Another limiter holding the frames (RivaTuner, Reflex) puts the cap back while it does. `vi: steady frame rate:` lines at each change say what the frames needed, and every 5 s what the rule was given (what the frames took and needed at p50 and p90, the present interval's p50, the waits a frame by kind, the frames kept and left out by reason, how many of the last 64 kept were late, and the probes and what the last three took unpaced); the `vk: frame pacing` line counts the present's holds |
| `HOS_FPS_STEADY_PROBE=0` | (Triforce, with `HOS_FPS_STEADY` or the Steady frame rate row) No unpaced probes: the rate by the frames' own measure as they run, as before test31 (`host/pace_steady.h` `pace_steady_probed`, `host/nn_vi.c` `steady_period`); the frames' work grows when they are paced slower, and that rule slides down |
| `HOS_PACE_SPIN=0`, `HOS_PACE_SPIN=<microseconds>` | (Triforce) The game's own frame wait on the high-resolution timer for the whole wait, as before, which wakes up to about 0.5 ms after the frame's time. By default the timer takes the wait up to 0.6 ms before the frame's time and the rest is yielded away on the clock, so the frame starts on its time (`host/pace_wait.h`, `host/nn_vi.c` `pace_sleep`); a number is another margin. Every 5 s in which frames waited a `vi: frame waits` line says how long after their time the waits ended, on average and at most |
@@ -160,7 +162,7 @@ screen. It costs some GPU time on cards that cull quickly, so it is off unless s
| `HOS_INPUT_EXCLUSIVE`, `HOS_INPUT_BACKGROUND`, `HOS_INPUT_SCRIPT_BACKGROUND` (set) | As above; the last lets every device count while the window is behind another one |
| `HOS_INPUT_RECORD=<file>` | (Triforce; unset: off) An input recording (`host/input_movie.c`, the format in `host/input_movie.h`): what the game is given each game frame, after every device and filter (the controller word and sticks, the flight and free camera cheats' inputs, the gyroscope, the native mouse camera's turns, the menu mouse's choices, the Debug tools' actions and rows), with Link's position and the camera's state as fingerprints. From the frame after Link's first update; `HOS_INPUT_FROM=boot`: from the game's first read. `HOS_INPUT_ROUTE=1`: no guest words or addresses in it (`HOS_INPUT_SAVE=<name>` noted in its header) |
| `HOS_INPUT_PLAY=<file>` | (Triforce; unset: off) A recording given back in place of the player's devices, the script and the bridge, from the same point, then the player's input again; the log says where Link or the camera first left it, and its end how many updates did. With `HOS_INPUT_RECORD` (another file) the replay is recorded too. `HOS_INPUT_SYNC=<n>` (1; 0: never) puts the camera and Link back every n-th update where they left it, while Link is within `HOS_INPUT_SYNC_MAX` metres (1); past that the replay has diverged. Exact only at the 60 cap with `HOS_REALTIME_STEP=0`, `HOS_FIXED_TIME`, the same save and settings. A run that records or plays from its start has no movie pacing (`host/nn_vi.c`). The control bridge starts and stops either at run time (`triforce_ctl.py record` / `play`) |
| `RX_VK_MENU_SCRIPT=<seconds>:<key>,...` | Timed Insert menu keys: `INS`, `UP`, `DOWN`, `LEFT`, `RIGHT`, `ESC`, `ENTER`, `TABL`, `TABR` |
| `RX_VK_MENU_SCRIPT=<seconds>:<key>,...` | Timed Insert menu keys: `INS`, `UP`, `DOWN`, `LEFT`, `RIGHT`, `ESC`, `ENTER`, `TABL`, `TABR`, and `APPLY` (the options' Apply, as its key) |
| `RX_VK_UI_PROMPTS=pad` or `keys` | The menu's button prompts for a controller or the keys, whatever was used last (screenshots) |
| `RX_VK_UI_GAME_FONT=0` | The menu, the counter and the start-up screen in the included Libertinus, not the game's own font |
@@ -195,9 +197,11 @@ case-sensitive, and an unknown one is ignored.
| `HOS_FPS_LOG` (set), `HOS_PRESENT_TRACE=<csv>` | The game's frame limiter, VRR flags and nominal rate every 300 presents; a CSV line per game present |
| `RX_VK_FRAME_LOG=<csv>` | A CSV line per present: frame, seconds, frame time in ms |
| `RX_VK_FRAME_TRACE=1` | A line a frame in `triforce_frames.csv` beside the game (the lab's scenarios keep it as `frames.csv`): present to present, the waits for shaders and pipelines, the uploads, and the replay's parts (`memsync_ms` ... `tex_lookup_ms`: the draws' parts are sampled and summed over every thread that records). (Triforce, wp20, `gpu/vk/frame_trace.h`) Then each frame split as the stall line splits a long one: `replay_ms` (the submits and the present phase), `present_ms`, `dispatch_ms`, `qsubmit_ms`, `par_wait_ms` (the replay thread's waits for its helpers' segments), `outside_ms` (the frame less the replay and the present: the game's own update), `game_wait_ms` (the game's fence waits), `captures_ms` (the captures at its submits), `wb_wait_ms` and `wb_held_ms` (the waits for write-backs, and their part after the writer's recording was done: `RX_VK_WB_WAIT_REC`), `qs_bg_ms` (the queue submits beside a background import), `gpu_waits_ms` ((Triforce, 11-22, the performance audit's SYNC-27) every thread's time in calls that block on the GPU, `RX_VK_GPU_WAITS` below). `python -I scripts/frame_rank.py <run folder or csv>` ranks what made the frames over the 99th percentile and over 1.5x the median by these, per window (the Market, the tour's stays, the loads) |
| `HOS_BENCH_PAN=<percent>` | (Triforce, 11-26; measurement only; `host/hos_bench.c`) The benchmark's camera turn (`HOS_BENCHMARK=<results.json>`, with `HOS_BENCH_SECONDS` a scene, 15 unset, and `HOS_BENCH_SCENES` the scenes, below): the right stick's push in percent instead of 35. `0`: the camera holds still in every scene, so an in-run A/B (`RX_VK_LAB_AB`) compares its phases on one view per scene (the turn takes about 18 s at Camera speed 100 and the game's default Camera sensitivity, so 300-present phases otherwise land on different views and their spread hides gains of a few tenths of a millisecond). The phases are counted in presents, not scenes: give each scene many phases (`HOS_BENCH_SECONDS=300`, as the `RX_VK_CHUNK` row's runs) and leave out the phases that hold a teleport, which the frame trace does not mark. `HOS_BENCH_SCENES=<action>:<name>,...` picks the scenes by the teleport actions of `host/hos_main.c` (1000 and up, in the order of `oot_destinations`: `1002:Kakariko` is Kakariko Village, which the `RX_VK_CHUNK` row's runs had in place of Kokiri Forest); unset: Hyrule Field, the Market, Kokiri Forest and Lake Hylia. Camera speed (the Controls tab, `HOS_CAMERA_SPEED`) and the game's Camera sensitivity scale the turn, and the game's own dead zone still applies, so a small push may hold the camera as `0` does. The leading number counts (`35%` is 35), rounded up to a whole unit of the stick's 32767, so `35` is exactly the push unset. Unset or empty: 35, as before; not a number (`nan` too) or outside 0-100: 35, and the log says so. When it is set, the log's `benchmark: HOS_BENCH_PAN=` line at the start says the push in force and the results have `"pan"` (its percent). Compare runs with the same value and the same Camera speed only |
| `RX_VK_SETTLE_GATE=1`, `=2` | (Triforce, 11-22, off by default; the performance audit's SYNC-29, after Source A's; `gpu/vk/settle_gate.h`) A CPU read that lets the stopped queues whose waits are met go on (the readback's look, which `RX_VK_RB_SETTLE=1` turns on, and the two looks made for a range a texture may be in) takes the order's lock whenever a queue is stopped, and that lock is held through whole replays and presents. With the gate a site looks only while a queue is stopped **and** the CPU has signalled an event since the last finished look, or a stopped queue waits on an event whose value is read from guest memory; any other met wait was met by a signal in the stream, and the thread that replayed it looked before it let the lock go. `1`: the readback's look; `2`: the texture sites' too (new ground: those looks order the exposure meter's readback, so `2` needs the lab's flicker count). Unset or `0`: every look as before. The `RX_VK_LAB_AB` knobs `settlegate` and `texgate` are `1` and `2` in their phases (`rbsettle+settlegate` is the pair the audit asks for). The 3000-readback line and the texture catch-ups' 300-call line count the looks made and skipped |
| `RX_VK_READBACK_LATE=<rule>[,<rule>]`, `RX_VK_LOG_READBACK_RANGES=1` | (Triforce, 11-22, the performance audit's SYNC-19, after Source A's; `gpu/vk/readback_late.h`) Ranges the CPU reads back **without** the wait for their write-back, from what guest memory holds (the last write-back made): a rule is a size in hex (`3980`: every range of 0x3980 bytes, the culling camera block Source A reads late by default) or `newest` (a range whose writer is the newest submission handed out: the game cannot have waited for it). **Unset: no rule**, every readback waits as before, until the lab has run it where the waits are long (a handheld, an AMD iGPU, a weak discrete card); `=0`: none either. The `RX_VK_LAB_AB` knob `rblate` is `3980` in its phases. A late read hands the game the frame before's values, and when the CPU resets a range read late the pending write-back lands over its reset (the exposure meter's flashes): `newest` can catch that meter, so it is never a default. `RX_VK_LOG_READBACK_RANGES=1`: with every 3000-readback line, the 12 ranges that waited longest (readbacks, waits, ms, how often their writer was the newest submission, how often read late), to find such ranges on other hardware; nothing is noted without it |
| `RX_VK_WB_WAIT_REC=1`, `=2` | (Triforce, off by default; the handoff's §12.9, `gpu/vk/wb_rec_wait.h`) A wait for a write-back still on the GPU (a capture's late pages on the game's submitting thread, a read or binding of a page put off) ends once the recording its submission was finished in is done on the GPU, not when the submissions' timeline reaches it: that timeline is held below any submission stopped at an event wait, and the lab's Market had 20-46 ms waits of the game's thread with the GPU 4 submissions behind. Whatever the switch, the wait for the recording comes first and the rest is counted: the stall line's `N of them X ms after their writer's recording was done`, the `late:` line's `ms of the wait after the recording that finished it was done`, the frame trace's `wb_held_ms`. Off: the captures' late-page wait orders something not known yet (`RX_VK_LATE_NEW`), so it is tried with the lab's flicker count first. (Triforce, 11-22, the performance audit's SYNC-122, after Source B's) The reads' side: a readback whose write-back is not recorded yet waited on the submissions' timeline with no bound and no second look; it is counted now (the 3000-readback line's second line), and the stall line names the held part by caller (takes, reads, binds, readbacks). The variable is a mode: `1` as above, and such a readback waits in 1 ms slices, looks its writer's recording up between them and ends with it; `2` is the check, where no wait ends earlier and the readback's slices count the part after the recording was done (what `1` would not have waited); unset, `0` or any other text: off, one wait as before. The check of the pages a later write-back changes (the audit's SYNC-101) is not built. `RX_VK_TL_REC=1` and the lab knob `tlrec` ended a capture's wait at a submission's first part, before its burst's write-backs were recorded: they now end it at the recording the submission was finished in, as `=1` here does; `RX_VK_TL_REC=2` keeps the old lookup |
| `RX_VK_RB_REC_END=0` | (Triforce, 11-27; `gpu/vk/wb_rec_wait.h` `readback_wait`, `tests/test_readback_rec_end.py`) A CPU readback of GPU results waits for the **last** part of the recording that writes it back. A recording made in parts (`RX_VK_CHUNK`'s counted parts, 240 draws on NVIDIA's driver, or Threaded rendering's pass-end parts) writes back at each part's end, all under the recording's one value, and the readback's wait looked that value up in a table that keeps the first part (`RX_VK_REC_LAST`, off, keeps a later one only when the value comes again). A read that came between the first part's submit and the last one's got what guest memory held then: OoT's exposure meter read as 0 where the GPU's sum was still to come, then the sum landed over the CPU's next 0 and the next frame added to it. In a still view the picture flashed brighter for a frame and stepped down: 3 times at Hyrule Field in a four-scene held-camera benchmark run (`HOS_BENCH_PAN=0`), on v0.8.4 too. Now the readback looks up the newest part submitted and whether it ended the recording: an ended recording's last part is waited for; one that goes on, the part found (the old wait), then 1 ms slices of the submissions' timeline between looks until it ends or the timeline reaches the value. A value not recorded yet goes to the fallback as before. `RX_VK_LOG_READBACK_ZERO=1` now says the writer's recording's first part, newest part and the recordings done at a zero read; the 3000-readback line counts the reads that waited past a part. Measured on an RTX 5090 (held camera): the meter's zero reads after a wait went from 0-10 a run to 0 in 4 runs, and Hyrule Field's flashes from 3 a run to 0. The rule waits 350-550 times a run, 2-5 ms each, on the game's worker threads, nearly all at a scene's load and in its first seconds. Frame rate unchanged (144.5 against 143.2 fps, 3 runs each); Hyrule Field's p99 frame time 9-13% higher. Waiting only for the part that wrote the range would be cheaper (not done). The rule's branches stay out of `invalidate` and submit_recording's registration, so that the renderer's play profile still matches them. `0`: the first part, as before |
| `RX_VK_LATE_QUEUE=1` or `0` | (Triforce, 11-20; 11-23) A capture's late pages (pages a submission still on the GPU writes back: OoT's exposure meter and the per-frame pools) waited for at the queue's next submit, not at the capture's take (`gpu/vk/vk_memory.cpp` `late_queue_on`). Unset: at the queue, except while the replay's submits are held (`RX_VK_BATCH`, on by default with Mesa's RADV): there a held submit applies no fix, the fixes wait for the batch's flush and copy guest memory the game has written again for its next frame, and the replay reads those slots live meanwhile: the lighting and exposure flicker on Linux AMD from 50-90 s into play in v0.7.0. `1`: at the queue with held submits too (v0.7.0 as shipped); `0`: at the take on every driver, as before 11-20. The log says `vk: late pages' wait ...` when it is first asked and when the answer changes |
| `RX_VK_LATE_INLINE=1` | (Triforce, 11-22, the performance audit's MEM-80, after Source B's; `gpu/vk/late_inline.h`; **off unless set**, not yet run in the game) A late page (one the CPU wrote while a submission still on the GPU writes it back) is waited for and taken again by default (`RX_VK_LATE_QUEUE`: at the queue's next submit). `RX_VK_LATE_NEW=1` (knob `latenew`) turns four no-wait rules on, each of which brought brightness steps back at the Castle Town save. This turns on the partial rule alone (knob `lateinline`): a page only part of which a submission on the GPU writes back has its other parts synced from the capture, no wait; pages of pools with no mirror, texture storage, pages written back whole and pages whose write-backs' ranges are not known are waited for as by default. The partial rule, here and under `RX_VK_LATE_NEW`, now asks which ranges are still on the GPU against the progress the capture read before its copies, not a second read at the take: a write-back done between the two counts as in flight, and its range is not synced from the older copy. `RX_VK_LOG_LATE` shows the pages waited for |
| `RX_VK_PASS_TIMING=1` or `2` | GPU time per pass (2: per program too), logged every 600 presents |
@@ -210,6 +214,14 @@ case-sensitive, and an unknown one is ignored.
### The GPU
The figures of the renderer changes measured on v0.8.4 on 11-27 against their lab knob's neighbouring phases
(`RX_VK_DESC_UBO_ONLY`, `RX_VK_PICK_WIDE`, `RX_VK_TPL_TABLE`, `RX_VK_BAKE_SCAN`, `RX_VK_CPU_WORDS_SEEN`,
`RX_VK_CAPTURE_PUSH_KEEP`, `RX_VK_BIND_SPAN` and `RX_VK_CAP_UNION_SHARED` below, `RX_VK_CAP_EXCL_GAP` under Running a
test) were taken while the knobs `nocapgap` and `nobindspan` were still asked at every left-out check and every binding
that may use a span (up to about 14,000 and 7,500 a frame), string compares of a few ns each that every knob's phases
paid and the phases without a knob did not. Each of those figures is likely somewhat high, by an estimated 0.03-0.09 ms
a frame; the two knobs are now asked once a phase and once a submission.
| Switch | What it does |
|---|---|
| `RX_VK_VALIDATION` (set) | The Khronos validation layer |
@@ -225,8 +237,8 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_NO_SPILLING_RATE=1` | (Triforce, the performance audit's PIPE-55, after Source A's; Linux build only) The Linux build sets `shader_spilling_rate=2` in its environment before the Vulkan instance is made (`gpu/vk/mesa_spilling.h`, `gpu/vk/vk_main.cpp` `create_instance`), unless the player has set that variable. Only Mesa's Intel shader compiler reads it: a program whose registers do not fit is built in fewer, larger steps (Source A, an Iris Xe: one compute program not built after 20 minutes and 13 GB, 32 s and 1.7 GB at rate 2). `=1` sets nothing, so the driver keeps its own rate. On Mesa's Intel driver the log has `vk: Mesa's Intel compiler spills at rate ...`. The Windows build sets nothing: under Proton, add `shader_spilling_rate=2` to the launch options. Not run on an Intel GPU here |
| `RX_VK_DRIVER_FAULTS=0` or `2` | (Triforce, 11-22, the performance audit's PIPE-57, after Source A's; `gpu/vk/driver_faults.h`) On AMD's own Windows driver only (`VK_DRIVER_ID_AMD_PROPRIETARY`), unless `0`: a program whose pipeline build faulted inside the driver is not asked of the driver again this run, and its key is appended to `triforce_driver_faults.txt` beside the executable (one line: vendor, driver version, program) by the fault's handler, before a fault during the start's shader work restarts the game, so the next start with that driver skips it instead of faulting again (`vk: driver faults: N programs ... kept out of it`; delete the file to try them again, another driver version ignores its lines). And one build of a program is inside the driver at a time: a second waits outside it, a probe of the caches is told a compile is required. `2`: on every driver (the lab's); `0`: nowhere. On other drivers nothing of it runs (`gpu/vk/vk_draw.cpp` `fault_quarantine`, `build_graphics`, `guarded_graphics`) |
| `RX_VK_PASS_BARRIER=game` or `full` | The barrier a draw pass starts with (`gpu/vk/pass_barrier.h`). `game`: a pass right after another, with nothing recorded between (no barrier of the game's, no copy, clear, uniform update or dispatch), waits for the earlier work in its fragment stages only, so its vertex, task and mesh work may overlap the earlier pass's fragments; a pass the replay itself split off for a hazard (`a pass of its own` in the log) and `RX_VK_BARRIER_EVERY_DRAW`'s keep a full one. (Triforce, P4) "Nothing recorded between" is the command buffer's own count (`RX_VK_BARRIER_CONTEXT`), so beside the Replay helper threads too. `full`: a full barrier at every pass start, as before. Unset: `game` with NVIDIA's driver, `full` on every other card. The log's `vk: pass barriers:` line says which, and the frame statistics' `pass starts ordered in their fragment stages only` how many a frame |
| `RX_VK_CHUNK=<n>` | (Triforce, 11-22, the performance audit's SYNC-66, after Source B's; `gpu/vk/barrier_rules.h` `part_draws`) How many draws and dispatches a part of a long submission has in a serial replay: the GPU starts on the first part while the rest is recorded, and each split costs a queue submit, two full barriers and the part's bookkeeping (about 27 a frame at 120). Unset: the driver's default, **120 on every driver** until the lab has measured one (Source B cuts at 128 where the GPU idles while the CPU records and at 4096 on desktop drivers); `0`: whole submissions, never split; `120`: today's size whatever a later default says. The size was read once into a static: now the `RX_VK_LAB_AB` knob `chunk:<n>` changes it in its phases while the variable is unset (`RX_VK_LAB_AB=chunk:480,chunk:240` with `RX_VK_PARALLEL=0`). The log's first `vk: a submission's parts:` line says the size in force and the driver's default |
| `RX_VK_SPLIT_BARRIER=pass` or `full` | (Triforce) A long submission goes to the GPU in parts of 120 draws and dispatches (`RX_VK_CHUNK`); `gpu/vk/barrier_rules.h`. `pass`: a pass open at a part's split goes on in the next part, begun again with the same targets behind a barrier of its attachments' outputs alone and with what its draws sampled and wrote, so the GPU does not drain between two draws of one of the game's passes; where the part's end records anything (its uniform updates, its write-backs) or an event's write is held, the full barriers as before. A parallel replay's segments are not split into parts: each begins and ends with a full barrier, so nothing goes on across a segment's edge. `full`: a full barrier at each part's end and the next one's start, as before. Unset: `full` on every card ((Triforce, 11-22, SYNC-66) this row said `pass` with NVIDIA's driver; `pass` has been off unless set since 11-16, when the lab's Market showed no gain from it: `barrier_rules.h` `split_in_pass`). The log's `vk: a submission's parts:` lines say which and, every 3,600 splits, how many went on in their pass and how many of those parts had uploads (whose own full barriers order them after the part before all the same) |
| `RX_VK_CHUNK=<n>` | (Triforce, 11-22, the performance audit's SYNC-66, after Source B's; `gpu/vk/barrier_rules.h` `part_draws`) How many draws and dispatches a part of a long submission has in a serial replay: the GPU starts on the first part while the rest is recorded, and each split costs a queue submit, two full barriers and the part's bookkeeping (about 27 a frame at 120). Unset: the driver's default, **240 on NVIDIA's driver** (its driver id, `VK_DRIVER_ID_NVIDIA_PROPRIETARY`, on Windows and Linux; 11-26, measured on v0.8.3: RTX 5090 at 2560 x 1440, the benchmark's four scenes with the camera held, `RX_VK_PARALLEL=0`, the knob `chunk:240` against 120 in neighbouring phases: 0.37, 0.18, 0.21 and 0.08 ms off the frame at Lake Hylia, the Market, Hyrule Field and Kakariko, +0.8 to +3.1% fps; on v0.8.4 (11-27, the same way, 300 s a scene): 0.55 ± 0.20 ms at Lake Hylia (6.3% fps), 0.42 ± 0.03 ms in the Market (5.1%), 0.26 ± 0.06 ms at Kakariko (3.5%), and at Hyrule Field, the fastest scene (183 fps), 120 was 0.05 ± 0.03 ms faster (0.9%); with this PC's default helpers 0.05 to 0.06 ms (0.8%, at Lake Hylia not significant); with the GPU slowed to about half busy (`RX_VK_SIM_GPU_SLOW=8`) 0.45 ± 0.06 ms at Lake Hylia (5.2%); 480 was mixed and 960 lost about 1.2 ms everywhere, the write-backs the game waits for starting too late; fewer cuts change which occlusion counts arrive in time, fewer straddling a split and some finishing later, and a count is written only when whole, so none is ever hidden; measured only on that RTX 5090 desktop, with the replay thread alone but for the default helpers' figure: 4-core and laptop PCs, NVIDIA's Linux driver and capped frame rates are not measured) and **120 on every other driver** (NVK, Dozen and Venus on an NVIDIA card too) until the lab has measured one (Source B cuts at 128 where the GPU idles while the CPU records and at 4096 on desktop drivers); `0`: whole submissions, never split; `120`: the size before, whatever the default says (on NVIDIA's driver too). The size, its default and the knob apply where parts are cut by count: with Threaded rendering off (the default) or `RX_VK_PART_PASS_END=0`. With Threaded rendering on and `RX_VK_PART_PASS_END` unset, a part ends where the game ends its render pass, from 120 draws (the first part from 32) to 512 (the log's `vk: a submission's parts end where the game has ended its render pass` line), and neither default is read: leave `RX_VK_CHUNK` unset there, because any value turns those parts off: a number above 0, 120 too, cuts every n draws wherever that falls, inside the game's passes too, and any other value (0, empty, negative) gives whole submissions (`RX_VK_PART_PASS_END=1` gives those parts on any run, and the variable is then read only in the knob's phases). The size was read once into a static: now the `RX_VK_LAB_AB` knob `chunk:<n>` changes it in its phases while the variable is unset (`RX_VK_LAB_AB=chunk:120,chunk:480` with `RX_VK_PARALLEL=0` and Threaded rendering off; with Threaded rendering's parts on, the knob's phases are counted and the phases between end at the game's passes, so add `RX_VK_PART_PASS_END=0` to compare sizes). The log's first `vk: a submission's parts:` line says the size in force and the driver's default, and when Threaded rendering's parts decide instead |
| `RX_VK_SPLIT_BARRIER=pass` or `full` | (Triforce) A long submission goes to the GPU in parts (`RX_VK_CHUNK`: 240 draws and dispatches on NVIDIA's driver, 120 on every other); `gpu/vk/barrier_rules.h`. `pass`: a pass open at a part's split goes on in the next part, begun again with the same targets behind a barrier of its attachments' outputs alone and with what its draws sampled and wrote, so the GPU does not drain between two draws of one of the game's passes; where the part's end records anything (its uniform updates, its write-backs) or an event's write is held, the full barriers as before. A parallel replay's segments are not split into parts: each begins and ends with a full barrier, so nothing goes on across a segment's edge. `full`: a full barrier at each part's end and the next one's start, as before. Unset: `full` on every card ((Triforce, 11-22, SYNC-66) this row said `pass` with NVIDIA's driver; `pass` has been off unless set since 11-16, when the lab's Market showed no gain from it: `barrier_rules.h` `split_in_pass`). The log's `vk: a submission's parts:` lines say which and, every 3,600 splits, how many went on in their pass and how many of those parts had uploads (whose own full barriers order them after the part before all the same) |
| `RX_VK_GPU_WAITS=0` | (Triforce, 11-22, the performance audit's SYNC-27; on by default; not yet run in the game) The host's calls that block on the GPU are made without being timed, as before. By default each is timed where it is wrapped (`gpu/vk/vk_work.h`, `gpu/vk/gpu_wait_kinds.h`) and summed by kind: `vkWaitForFences` and `vkWaitSemaphores` with a timeout above 0 (fences, timelines), `vkQueueWaitIdle` and `vkDeviceWaitIdle` (idle), `vkGetQueryPoolResults` with the wait bit (queries). Polls count nothing, a wait inside a wait counts once, and the low-latency sleep's wait is left out as pacing. After each 120-present line the log has `vk: host waits for the GPU: ... ms a frame (fences, timelines, idle, queries; all threads)`, which counts what that line's "GPU-bound wait" (the recording slots' waits alone) does not, and the frame trace has `gpu_waits_ms`. The cost is two clock reads a blocking wait. The `RX_VK_LAB_AB` knob `nogpuwaits` turns the count off in its phases |
| `RX_VK_ORDER_WAKE=1` | (Triforce, 11-22, the performance audit's SYNC-59; off unless set; not yet run in the game) A queue stopped at a wait for an event goes on when a submit finds the wait met. A signal of the CPU's (`nvnEventSignal`) wakes no one: the stop waits for the order thread's next `Sleep(1)`, or a game thread's wait yields up to 3 ms and then forces it. With the switch (`gpu/vk/vk_replay.cpp` `sync_watch`, `event_signal_queued`) the order thread waits on an auto-reset event, 1 ms at most, which the signal sets while a queue is stopped: one `SetEvent`, no lock and no replay on the signalling thread. And a game thread's wait for stopped work that sees a signal pending lets the queues whose waits are met go on first, as `sync_settle` does; nothing is forced. The order line counts the wakes and those that let work on: under about one a second, leave it off. The `RX_VK_LAB_AB` knob `orderwake` turns it on in its phases |
| `RX_VK_RELEASE_QUEUE=1` | (Triforce, 11-22, the performance audit's MEM-85, after Source B's idea; `gpu/vk/release_queue.h`; **off unless set**, not yet run in the game) Without the replay thread (`RX_VK_ASYNC` unset), a texture or program the game finalizes is let go by its own thread: held for the replaying thread only while a queue is stopped at a wait (PR 430), otherwise after `sync_drain` and the replay's lock, which a replay holds through whole submissions. With this on, every such release goes to a list the replaying thread applies at the start of the next submission's replay or present when no queue is stopped (after the stopped work otherwise, as PR 430's); a texture's release counts the game's writes from the write generation of its call, so writes after the call are still uploaded. The `RX_VK_ASYNC` job path is not changed. The `RX_VK_LAB_AB` knob `relq` turns it on in its phases. On in every run, a count: every 600 releases a `vk: releases` line when one of them waited 0.5 ms or more for the replay or its order (how many, the time in all, the longest) or went to the list. Not built: the entry's `rel_wait_ms` column in frames.csv |
@@ -329,7 +341,9 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_VIEW_KEEP=0` | Any texture's end (an eviction, a dead render target let go, a texture made BC3 from BC1, the compaction moving one) makes every texture look of every recording thread stale, and each is resolved anew when next met (the slot, the cache, the view, under the parallel replay's lock), as before. By default a thread that finds the destroy generation moved keeps the looks of the textures whose views did not go: those are noted by their creation number before the generation moves (`gpu/vk/view_keep.h`, `vk_draw.cpp` `texture_view_of`); never a look of no texture or no view, nor a flat texture's 3D copy. More than 1024 gone since a thread's last pass: all resolved anew. The log's `vk: texture looks kept` lines count them, the stall line the views resolved anew. After NX2navi's `tex_gen_undo` |
| `RX_VK_DESC_KEEP=0` or `check` | The per-binding reuse of a draw's descriptors (`gpu/vk/desc_keep.h`, on by default): a draw that builds its descriptors takes, for each sampled texture, user uniform buffer, stage's constants and read-only storage buffer, what the program's last draw on that thread resolved it to, while everything it was resolved from is the same: the texture's handle, its slot's registration, the samplers', no texture destroyed or made again, no texture left for later and the same submission; the buffer's address and size, no inline uniform update, no pool moved or mirror made, the same recording. `0`: every descriptor resolved, as before (so also with `RX_VK_NO_DESC_REUSE`, `RX_VK_SAMPLER_CACHE=0` and the descriptor diagnostics). `check`: every descriptor resolved too, and one that comes out otherwise than what was kept for the same inputs is counted and logged (`vk: descriptor reuse check`): the way to try the rules. The frame statistics' `a frame's descriptors` line says how many were resolved and taken, how many pushes were whole, of the changed bindings or of nothing, and how many sets were written, through a template, or bound again |
| `RX_VK_DESC_SIG=0` or `check` | The whole-draw skip by the signature of a draw's descriptor inputs (`gpu/vk/desc_sig.h`, on by default with the per-binding reuse): a draw whose bindings moved, of the program whose descriptors its last draw pushed in that command buffer, first reads what each of them is resolved from (a texture's handle and its slot's version, a user uniform buffer's address and size, a read-only storage buffer's address and size words, a driver bank's stage generation) and the stamps the per-binding reuse gives each kind; when that equals the signature the pushed descriptors were built from, and their build kept every one, the build and the push are left out (a build would take each of them again and push nothing). Push programs only, of the kinds the per-binding reuse keeps: not those with storage buffers they write, tables, texel buffers or storage images, not the mesh fallback or RenoDX's. `0`: built, as before. `check`: built too, and one that comes out otherwise than what is pushed is counted and logged (`vk: descriptor signature check`). The frame statistics' `a frame's descriptor signatures` line says how many draws read theirs and how many were kept whole |
| `RX_VK_DESC_UBO_ONLY=0` or `check` | (Triforce, 11-26; `gpu/vk/uboonly.h`, on by default) A draw keeps the last descriptors only while nothing at all was bound anew, and every changed uniform buffer bind counts, so the next draw of the same program with one per-object uniform buffer of its own ran the whole `build_descriptors`: every texture handle read and looked for among the kept results, every storage buffer's words, the banks' cache, the writes (about 2,100 builds a frame at Lake Hylia, 1,600 to 1,700 of them pushing 1.5 descriptors each, on the thread the frame waits for). By default such a draw resolves its user uniform buffers alone (c3 to c18, each through `kept_uniform` as a whole build does) and leaves the rest of the thread's last build as it is, only where a whole build would take every other descriptor from what was kept: the program this thread built and bound last (a dispatch's build in between ends it), no texture, sampler, image or storage buffer bound to its stages since (`tex_gen`, `ssbo_gen`), the per-binding reuse's stamps what they were before that build (the recording, the bind stamp, the samplers', the destroy and dummy generations, the texture epoch), every other descriptor's result kept and no slot of its textures registered anew (walked once after a whole build, and again after a registration), and a program whose other descriptors no uniform buffer can move: the kinds of descriptor the signature skip keeps (no written storage buffer, table, texel buffer, storage image, turf list, run-time pointer, nor the miss binding; not compute, the mesh fallback or RenoDX's), but only stages 0 to 4 (no task or mesh stage) and set programs as well as push ones, and no texture handle or storage buffer address read through a handle program or from c3 on (the program's plan is made once a program a thread, and again after another program took its slot). Not for a draw that may not leave textures for later, a dump, or the upscaler's second recording; off with `RX_VK_DESC_KEEP=0` or `check`, `RX_VK_DESC_SIG=1` or `check` (the signature skip, off by default), `RX_VK_BANK_GEN_OFF`, and where uniform buffers are snapshots (`RX_VK_UB_SNAPSHOT`; by default every Intel GPU, and any other integrated GPU whose pools have no VRAM mirror). A stamp that moves while the uniform buffers resolve (a mirror made) makes the whole build follow. `0`: every such draw builds whole, as before. `check`: built both ways and compared descriptor for descriptor and sampled texture for sampled texture, a difference counted and logged (`vk: uniform-buffer-only build check`), the whole build used. Since every such draw then ends in a whole build, `check` tries the rule only right after a whole build, never over a build of the uniform buffers alone as the default mode chains them; that state is tried by `tests/test_uboonly.py` alone. Each compared draw resolves its user uniform buffers twice, so a `check` run's descriptor counts and stream use are neither mode's. Any other value: on (told once). The lab's knob `nouboonly` (`RX_VK_LAB_AB`) is `0` in its phases. The frame statistics' `a frame's uniform-buffer-only builds` line says how many of a frame's builds resolved their uniform buffers alone, and for the next draws of the last program that did not, why: the program's kind, a texture or storage buffer bound, a stamp moved or a result not kept; in `check` none counts as resolved alone (each was built whole), and the line says how many were compared and how many differed. Such builds count among `a frame's descriptors` builds, but only their uniform buffers count as resolved or taken there. Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.176 ± 0.069 ms (2.3% fps); with the replay alone at the Market 0.125 ± 0.073 ms (1.6%), at Hyrule Field 0.027 ± 0.022 ms (not significant). The check run (all four scenes, every rider checked at once): 5,319,517 builds made both ways, 0 different |
| `RX_VK_DESC_COUNTS=0` | (Triforce, 11-22, the performance audit's DESC-22, after Source A's; `gpu/vk/desc_counts.h`) `build_descriptors` walks the program's stages at every build to sum its buffers, images and texel views, as before. The default keeps the three sums packed on the program (`Program::desc_n`, 10 bits each, in the padding after `ready` so that `sizeof(Program)`, which the shader caches' stamp holds, stays what it is): stored at the program's first build once it is translated, read at every later one. A program with more than 1023 of a kind walks at every build. A build that went by kept counts and had one of its three vectors move is made again, walked, and that program walks from then on (one log line). The lab's knob `descwalk` (`RX_VK_LAB_AB`) is this switch in its phases |
| `RX_VK_PICK_WIDE=0` or `check` | (Triforce, 11-26, the GPU audit's C02; `gpu/vk/pickwide.h`, `gpu/vk/vk_shader.cpp` `program_for_wide`; measured on v0.8.4 at the end of this row) `=0`: a graphics draw's program is `program_for`'s alone, as before: its pair of last picks, which compares `ub_generation()` and so misses after every inline uniform update, and on a miss the inputs' hash, the picks' table, every answer's handle read and, where one differs, all of them read again with their types compared. The default asks a memo of the recording thread's own first (16 sets of 2 by the program object's serial, one entry a program object, vertex inputs and colour types): an entry stands as the pair does and, for a program whose answers are all handles in c2 of their own stages (`answer_stage_mask`, from its descriptors), across uniform updates too, since c2 is served from the bound textures alone; an entry whose textures moved is asked in one pass over its answers (each handle read once, a slot seen and checked at its version not asked again, the others' types compared canonically, an unbound slot taking any: `still_valid`'s verdict); anything else is `program_for`, whose program is only noted there (its inputs and a pointer: no answer read) and kept once a pass, at those inputs' next draw, finds it of the bound textures' types, so a program drawn once before its entry is replaced costs only the memo's find and the note. Mesh and compute picks are `program_for`'s, and `program_for`'s own line (`vk: program picks: N kept ... of N`) then counts only the picks that come to it. The one known way to another program than with `=0`, both of the bound textures' types: `program_for` empties a thread's picks past 65536 keys and takes the first fitting variant in the list's order, where the memo keeps the one it has (two can fit when an answer is unbound). The memo stands in front of `program_for` and not in it because `program_for` is in the translation stamp: no token of the stamp changes, so no shader cache starts again. `RX_VK_PICK_BIND_GEN` (set to anything, as `program_for` reads it): an entry stands only while nothing at all was bound and no uniform updated, the pair's old rule. `RX_VK_DEFERRED_LATE` (likewise): an entry stands on its stages' textures, but not past a uniform update. The switch is read as a number: `check` (exactly) is the check, a number other than 0 the default, and `0` or any other word (`on`, `Check` and an empty value included) `=0`, logged. `=check`: a draw the memo answers is asked of `program_for` too, whose program is drawn (the others are `program_for`'s alone); the differences are counted, and of them the memo's programs not of the bound textures' types (a wrong variant is NaN on screen), the first 20 logged, and a difference reaches the line's totals at once, with every count its thread held; `program_for` being asked at every draw there, its pair and its picks move as with `=0`, so `check` tries the memo's answers and not the state of the default mode, where `program_for` is asked seldom. The lab's knob `nopickwide` (`RX_VK_LAB_AB`) is `=0` in its phases (a thread's memo is cleared at each change). The line "vk: a frame: ... draws kept their neighbour's descriptors ...; N program picks by the wide memo (N past a uniform update), N by one pass over their answers (N of them a noted program's first, N types compared), N by program_for (N of its programs not of the textures at their next draw, in all)" counts them a frame, with check mode's totals behind; "by program_for" near the memo's count says a stretch of the frame draws more programs than the memo holds, or one program object with three or more sets of vertex inputs or colour types in turn: the memo's set is by the program object's serial alone, so those take one set's two ways in turn and none of them ever gets a memo answer. With `=0` and in the `nopickwide` phases nothing is counted, so the line's picks are 0 there but for what a thread held from the phase before. Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.130 ± 0.056 ms (1.7% fps). The check run (all four scenes, every rider checked at once): 7,902,642 picks compared, 0 differences |
| `RX_VK_PROF_ALL=1` (the dispatch's pick clock) | (Triforce, 11-22, the performance audit's DESC-30, after Source A's and Source B's) Every profiling scope timed, and with it the clock pair around each compute dispatch's program pick, as before. Unset, the pick's time for the stall line is the change of the thread's exactly timed nanoseconds across the pick (its slow path is timed by `PROF_EXACT`), so a pick the memo answers reads no clock. DESC-30 has no switch of its own, the results being the same: besides the pick, `taau_key` answers from its list parsed once (it wrote the key out and walked the list as text several times a dispatch), `RX_VK_LOG_PUSH` formats its key only when set, the first-pipeline clock is read only when there is one to make, and `texture_frame` fills `RX_VK_LOG_BAKED`'s list only for that switch (read once) and finds its largest textures by a partial sort. The lab's knob `diagold` (`RX_VK_LAB_AB`) puts all of it back in its phases (`gpu/vk/vk_draw.cpp` `dispatch`, `taau_key`, `dispatch_diag_old`; `gpu/vk/vk_texture.cpp` `texture_frame`) |
| `RX_VK_LAB_AB=e_draw:<ns>`, `e_dispatch:<ns>`, `d_present_after:<us>` | (Triforce, 11-22, the performance audit's REPLAY-51, after Source B's; lab knobs of the in-run A/B, `gpu/vk/lab_ab.h`, nothing without the variable) The `d_<site>` knobs wait once a frame; `e_draw` and `e_dispatch` wait the knob's nanoseconds at every draw or dispatch, first in `draw()` and `dispatch()` so the profiles leave it out, on whichever thread records, and count each wait. The frame's change against the time spun says how much of that path is on the frame's critical path (200 ns at about 3,050 draws a frame is 0.6 ms of work). A phase's end logs `vk: lab A/B: phase e_draw:<ns> over:` with its waits and ms a second. `d_present_after` is `d_present`'s control: the same wait just after the present's `drain(0)`, where `d_present` is just before it. Pin `RX_VK_PARALLEL` with the `e_` knobs (the log warns otherwise): Automatic moves draws between threads. Off: one relaxed load a draw. `tests/test_lab_ab_each.py` |
| `HOS_OOT_SHADOW_STEP=<n>` | (Triforce, 11-21, the performance audit's GAME-05) The game gives each nearby character or object a square depth shadow map sized by its size on screen, 384 to 1,920 a side, so while anything moves each frame asks for depth textures of sides not seen before. The one read of the side is rounded up to a multiple of `<n>` (a power of two up to 256; 64 when not set): 25 sizes, which come round again, so the render targets' pool serves them. A map gets at most 63 more texels a side; its projection does not change. `0` or `1`: the game's own side, as before (`host/oot_shadow_step.h`, `host/oot_shadow_step.c`, `nx2/oot_patches.py` `patch_shadow_step`) |
@@ -340,6 +354,7 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_TEX_WARM_LIST=1` or `2` | (Triforce, 11-22, the performance audit's TEX-23, after Source A's; off unless set, and only with `RX_VK_TEX_WARM=1`) The textures made ahead by a list of what was drawn (`gpu/vk/tex_warm.h`). Every registered slot made ahead needs the 40% rule, and on an 8 GB card that rule stops the warming at once. With the switch, a BC or ASTC texture a draw uses within 90 s of the game making it is learnt: its shape and eight 64-byte samples of its bytes, at its storage's address. The list is kept beside the game as `triforce_textures_drawn.bin` (32,768 at most; saved every 300 presents when it changed; a file cut short or of another version is not read). At a light frame the ripe slots the list names are made while the textures and 256 MB more fit their budget and the render targets' pool is not being given back; `1`: the others after them, by the 40% rule, once no noted slot is left ripe; `2`: the listed alone. The look itself learns nothing. "vk: textures made ahead by the list" counts listed, unlisted, learnt and no-room. Unset or `0`: every registered slot as above. Not measured: lab proof first (the entry's own default is `1`). `tests/test_tex_warm_list.py` |
| `HOS_MEM_LIMIT=1` or `<MB>` | (the lab's) The game's memory held to what it is told it has, as the console holds it. The game is told 9809 MB, but nothing was refused until the PC's own commit ran out, and it holds 11.7 GB by its own count in a fresh Market and 13.5 GB after a tour (the `mem: census` line), with its GPU heap within 15 MB of full and its texture compaction running every frame. `1`: `AllocateMemoryPages` and `MapPhysicalMemory` are refused past the 9809 MB, and `UsedMemorySize` is the game's count; a number above 1: refused past that many MB. Unset or 0: as before. What the game does when refused is what the lab is to find out. `host/hos_mem.c`, `tests/test_mem_limit.py` Refused, the game asks again thousands of times, each ask a region taken and freed; a region of the game's own freed with none of its pages in it is no longer discarded (`hos_region_discard_needed`), and the regions it frees with pages in them are discarded with the thread's virtual core given up. Those two were the stutter when walking with the limit on: in a three-area lab run the game's own part of the frame was over 8 ms in 24% of the frames before and in 0.3% after (as without the limit), 63.8 fps to 100.0. **`=1` does not fit this build:** the heap takes 6.9 GB of the 9.8 and an area's resources need 4.7 GB and more, so a save's load can starve and stay on its loading screen for good (the owner's, 2026-11-20, read with the hang watch's stacks: the game at 9,807 MB, its load threads idle). Use a size in MB: `12800` loaded and played four areas without reaching it. |
| `RX_VK_DESC_SET_KEEP=0`, `RX_VK_DESC_TEMPLATE=0` | A program over the driver's push limit (32 descriptors on NVIDIA's, AMD's and Intel's drivers) has a set written for each draw that builds its descriptors. By default a set whose descriptors are all as those of the last one written for that layout in the recording is bound again instead, while no texture was destroyed or made again and no pool moved, and a set written is written through the program's descriptor update template (Vulkan 1.1). (Triforce, after NX2navi's `desc_template`) A program within the push limit has its descriptors pushed whole (in a new command buffer, or after another program at its bind point) through a push descriptor template of its own (`vkCmdPushDescriptorSetWithTemplateKHR`, one a program and bind point, from the same entries and packed array as a set's), not with the write structs the driver walks one by one; a push of the changed bindings only keeps its write structs. The frame statistics' `a frame's descriptors` line counts the pushes made through it. With `RX_VK_RECORDER` the packet copies the packed array (`gpu/vk/vk_recorder.h`). `RX_VK_DESC_SET_KEEP=0`: a new set each time; `RX_VK_DESC_TEMPLATE=0`: sets written and pushes made with the write structs; both as before |
| `RX_VK_TPL_TABLE=0` or `2` (`check`) | (Triforce, 11-26, the GPU audit's C31, its part (a); `gpu/vk/tpltable.h`, `gpu/vk/vk_draw.cpp` `set_template`, `push_template`) A program's update template and push templates are kept in maps by the program behind one mutex (`tpl_mu`), and each thread had 8 entries a kind of template in front of them (one table for sets, one for each bind point's pushes), by the program's address. A frame pushes the descriptors of far more than 8 programs (335 to 535 sets pushed in full a frame, each through its template), so most lookups took the mutex and searched a `std::unordered_map`: 0.8% of the Presentation Thread's time at Lake Hylia and 1.1% in the Market (about 0.07 and 0.06 ms a frame; expected back, with the lock pair, 0.08 to 0.11 ms at the lake and 0.06 to 0.08 ms in the Market; measured on v0.8.4 at the end of this row), and the replay's helper threads met on the one mutex. By default each thread that looks templates up has a table of 512 sets of 2 entries (16 KB, one for the three kinds of template) by a multiplicative hash of the program's address and the kind, made at its first lookup and freed when the thread ends (none with `RX_VK_TPL_TABLE=0`, nor with `RX_VK_DESC_TEMPLATE=0`, which makes no templates). An entry is what the 8 held, and what is found is checked the same way before it is used (the template's layout is still the program's); a miss is the locked path as before. Only where a template is found changes, not which template or what is pushed. A set keeps its two keys first in, first out, so a set that three or more of a frame's keys fall in misses on each of them every frame: in a play test's frame statistics, the lines of 400 lookups a frame or more still took the lock on about 10% of them (21% at worst). More ways or another hash are a change of their own, to be measured. The table is beside the program, not on it (`sizeof(Program)` is in the shader caches' stamp). `RX_VK_TPL_TABLE=0`: the 8 entries, as before; `RX_VK_TPL_TABLE=2` or `check`: the check, every template found in the table also asked of the map under the lock (so every lookup takes it) and the differences counted; the table's template is still the one used. Another value is read by its leading number, as `atoi` reads it: 2 (as in `02` or `+2`) is the check, 0 the 8 entries when the value starts with 0 (as in `00`), anything else the table, as by default; any value other than `1` or empty is logged once, with what it gives. The lab's knob `notpltable` (`RX_VK_LAB_AB`) is the 8 entries in its phases. The frame statistics' `a frame's descriptor templates` line counts the lookups, how many of them missed the table and took the lock, and the check's result, labelled by the switch (not by the lab's phase). Tests: `tests/test_tpltable.py`, `tests/test_desc_sets.py`. Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.192 ± 0.090 ms (2.6% fps). The check run (all four scenes, every rider checked at once): 4,618,250 templates checked against the map, 0 different |
| `RX_VK_CREATE_NEW_MS=<ms>` | While the hold is on, a sampled texture seen for the first time once the frame's makes took this long (8), or its uploads their budget, is not made yet (`vk_texture.cpp` `create_later`): the draw samples the dummy, the frame is held, the next frame makes it. The frame's first make always goes; never a dispatch's. `0`: made at once, as before (a texture left for later was made all the same). The stall line counts the textures made, their time, those not made yet, and the images made |
| `RX_VK_UNSWIZZLE_MT_MB=<MB>` | A block-linear level unswizzled on the CPU is split over several threads (a thread for each 2 MB, 8 at most) from this size (4); `16`: from 16 MB, as before |
| `RX_VK_PROGRAM_READAHEAD=<n>` | After a draw reads a program from the program cache itself, or takes one read ahead, workers read the next `n` programs (32) and keep them made for the draws that come to them, 512 at most (`gpu/vk/program_readahead.h`). `0`: none, as before. The log's `vk: programs from the cache` lines and the stall line count them |
@@ -379,6 +394,7 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_PREDICT_CHECK=0`, `=2` | (Triforce, 11-22, the performance audit's PIPE-68, after Source B's and Source A's; `gpu/vk/predict_check.h`) On unless `0`. The predicted pipelines are built once for the driver's own cache and a record says which programs are done; a driver can lose them all the same (NVIDIA's cache cap, a cleared cache folder, AMD's Windows driver keeping a third). At a start whose record says all are built, the builder's idle thread, after its delay and only while the frame shown is a light one, samples up to 12 of them spread over the plan: each built for the driver's cache alone and timed, then once more as the warm reference; cold is a first build over 4 times the second and 3 ms more, and the sample ends once its majority is decided. Cold: the record is removed, so they are all built again behind the game at light frames, and `<notes>.predicted.check` takes a strike for these shaders and this driver; cold again after that, the log says this driver does not keep them and no later start checks. Warm: the strike is forgotten. `2`: checked at every start, a recorded stop too. Also counted: the builds in play of programs the plan predicts that took over 20 ms (`vk: predicted pipelines: N builds in play of predicted programs took over 20 ms`, at most every 10 s while it grows). `0`: neither the check nor the counter, as before (`gpu/vk/vk_draw.cpp` `predict_check_cold`, `predict_background`, `predicted_play_build`) |
| `RX_VK_PREDICT_TYPES=1` or `0` | (Triforce, 11-22, the performance audit's PIPE-44, after Source A's; `gpu/vk/predict_types.h`) Unset: each predicted pipeline is built once for its program, by its key as play keys it (two predicted layouts that differ only in what is dynamic, a stride, gave the same pipeline twice): the same pipelines, fewer builds. `1`: that, and the plan drops a predicted vertex layout whose attributes definitely differ from the program's vertex inputs (an integer input against a float attribute, or the other signedness, read from the vertex module's SPIR-V; scaled formats count as integers): such a pipeline is invalid. Off by default because it changes which pipelines are built, and it applies to a plan made after it is set (a plan is made once for the shaders). `0`: every predicted pipeline built, as before. The predicted lines say how many were left out as built already, how many programs the programs' file did not lend, the notes of variants it has no shaders for and the layouts that did not fit (`gpu/vk/vk_predict.cpp` `predict_pipelines`, `gpu/vk/vk_draw.cpp` `predict_first`) |
| `RX_VK_DRAWN_PAGE_MAP=0` | (Triforce, 11-21, the performance audit's TEX-21) A texture in a virtual pool is checked through its mapping, 64 KB a page, and its page map was recorded at its first check: one the GPU drew first had none, so once the game finalized it the first check took its whole storage as mapped since and uploaded it from memory over what the GPU drew (HUD labels and render targets blank after an area change, up to 15 MB an upload). The map is recorded at the first draw that says who drew it, and the later check gives only the pages mapped anew or written by the CPU. Not for a write that gives no reason (a clear, the movie upscaler). The log counts them. `0`: at the first check, as before (`gpu/vk/drawn_page_map.h`, `vk_texture.cpp` `texture_written`) |
| `RX_VK_BAKE_SCAN=all` (or `0`), `=check` | (Triforce, 11-26, the GPU audit's C36) The bake write-back (a texture the GPU drew in one frame, such as a terrain tile's normal map, gets its texels written into the game's memory) looked for its textures by walking the whole texture cache every fourth present, a dozen tests a texture: 1.1% of the Presentation Thread at Lake Hylia and 0.9% at the Market (about 0.35 / 0.2 ms on each fourth present), for a walk that finds nothing where the recordings write them back themselves. The textures it can take (drawn in one frame, their texels not in the memory yet) are now listed where they become so (`texture_written`, and the step's two lost copies; a destroyed one leaves the list in `forget_gpu`), and the step asks the rest of its test (four presents old, sampled lately, not released nor only cleared, small, in the guest window, with an image whose format can be copied out) of the listed ones only; a listed texture stays listed until it is written back, drawn in a second frame, its contents dropped or destroyed. Under the step's caps (24 textures, 8 MB) the oldest listed go first, where the walk took the hash map's order, and one no step can take (more than 8 MB of storage) is passed over, where the walk stops at it as before; so the same textures are taken, but for those the walk does not reach behind such a one. Default: the list. `all` or `0`: the walk of the whole cache, and no list, as before (with `RX_VK_BAKE_WRITEBACK=0` there is no list either); `check`: the walk of the whole cache, and every armed texture the list does not hold is counted and logged, each once (must be 0). Lab knob `nobakescan` (`RX_VK_LAB_AB`): the whole cache in its phases. A line of its own every 600 presents counts it: "the bake write-back's scan: by the list at N steps (N listed textures looked at; the cache held N at those steps), ... armed and not listed ...: 0" (`gpu/vk/bakescan.h`, `vk_texture.cpp` `bake_writeback_step`). Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.145 ± 0.062 ms (1.9% fps). The check run (all four scenes, every rider checked at once): 0 armed textures not listed |
| `RX_VK_DEAD_SUM=0`, `RX_VK_DEAD_POOL_NOW=0`, `RX_VK_DEAD_MIN_UNUSED=3` | (Triforce, 11-21, the performance audit's TEX-30) The frame's transient render targets, drawn over from another start: the other targets' parts over one are added up, each byte once, so one covered at its head by one target and at its tail by another, each under an eighth, is let go too (it was kept for good); it is dead after 1 unused present, not 3; and its image goes to the render targets' pool in the pass that lets it go, once the GPU is done with it, not at the next present. `RX_VK_DEAD_SUM=0`: judged one by one; `RX_VK_DEAD_POOL_NOW=0`: pooled at the next present; `RX_VK_DEAD_MIN_UNUSED=3`: three presents: each as before (`gpu/vk/target_overlap.h` `ShiftedOver`, `vk_texture.cpp` `texture_sweep`) |
| `RX_VK_ASTC_REUSE=2` | (Triforce, 11-21, the performance audit's TEX-14, its first step; off when not set) When the game comes back to an area it makes its textures again, mostly at other addresses, and the same ASTC blocks are decoded and encoded again while the image made of them the first time may still be in VRAM. With `2` a new ASTC texture's blocks are hashed at its first upload (128 bits), the textures the game finalizes that were uploaded from memory and never drawn into are listed, and each new texture with a listed one's blocks and shape is counted: the log's `decoded ASTC used again` line says how many MB of images a copy would have stood in for, and what the hashing cost. Every texture is decoded as before. The copy itself is not built: the walk it was measured on would have reused 0 to 11 MB, and the audit asks for 500 MB on a tour before it is (`gpu/vk/astc_reuse.h`, `vk_texture.cpp` `reuse_upload`) |
| `RX_VK_KEEP_OBSOLETE=1` | (Triforce, 11-21, the performance audit's TEX-43) A texture the GPU drew in one frame is kept after the game finalizes it, for being made again over that storage and sampled undrawn (the terrain's tiles; `RX_VK_KEEP_FINALIZED_MB`). One of 32 KB or more, in no virtual pool, whose storage the CPU has written three quarters of since the release holds nothing that memory holds any more: the sweep lets it go whatever the budget says, where only a draw over it did, and the game's own writes kept each for good (about 200 render target images an hour in players' logs). The log counts them. `1`: kept, as before (`gpu/vk/finalized_obsolete.h`, `vk_texture.cpp` `texture_sweep`) |
@@ -393,6 +409,7 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_NO_WRITEBACK` (set) | GPU writes to mirrored pools are not copied back to guest memory (an experiment, for A/B) |
| `RX_VK_MSYNC_PASS=0`, `=1` | (Triforce, 11-21, the performance audit's MEM-48) A mirror sync's pages that come from a capture's buffer go to the pool's VRAM mirror by the write-back diff's compute pass, one dispatch a sync, where they were copy regions of a page or a few each (700 to 1,300 a frame, each read over PCIe after the one before). A run not in whole words, a GPU without subgroup votes in compute and a sync whose chunk table finds no room keep the copies; a mirror written twice in one upload command buffer, once by the pass, gets a full barrier between. On for NVIDIA when not set; `1`: on every GPU; `0`: copy regions, as before. The log's `mirror syncs' pass (600 submits)` line counts dispatches, chunks, fallbacks and barriers; `RX_VK_LAB_AB=nomsyncpass` is the in-run comparison (`gpu/vk/msync_pass.h`, `vk_memory.cpp` `msync_pass_add`, `msync_pass_flush`) |
| `RX_VK_WB_FORGET_SORT=1` | (Triforce, 11-21, the performance audit's MEM-61) At the end of each part with write-backs the write-back diff clears, for every page written since, the bit that says its pool's shadow knows the page. The three lists of such pages (the game's writes, the collection's, the replay's) were sorted first, thousands of pages a part, only so that the pool found for one page serves the next; the bits and the counts do not depend on the order, and the lists hold ascending runs as they come. They are no longer sorted. The log's `forgetting the written pages took` line gives the time. `1`: sorted, as before (`vk_memory.cpp` `shadows_forget_written`) |
| `RX_VK_CPU_WORDS_SEEN=0`, `=check` | (Triforce, 11-26; on by default; measured on v0.8.4 at the end of this row) Every word of a counter report the replay writes into guest memory is noted again each time (`gpu/vk/vk_memory.cpp` `memory_cpu_owned`), as before: pushed, then sorted and searched for in both sets of such words at the next part's end with write-backs (`cpu_words_merge`), where the same words of every frame are found and dropped (1.6% of the Presentation Thread at Lake Hylia, 2.5% at the Market on v0.8.3). Without it a table of the words the sets hold answers at the note (`gpu/vk/cpuwordsseen.h`), and a word held already is not pushed. An entry is the word's whole address and the sets' generation, and the table forgets where the sets are cleared (past 65,536 words), so it never calls a word known that the sets do not hold: such a word would be copied over by a mirror's write-back, the one-frame dark flashes of 11-07. The sets and the write-backs' cut runs are the same (`tests/test_cpuwordsseen.py`). `RX_VK_CPU_WORDS_SEEN=check` notes every word as before and looks each word the table knows up in the sets. Any other value: the table, as unset, and logged. The log's `mirror syncs (600 submits)` line ends with `report words: N asked of the table, N known to it and not noted again (noted all the same with =check), the sets forgotten N times, N check mismatches since the start (RX_VK_CPU_WORDS_SEEN)` (the first three since the line before; nothing is asked of the table with `=0` or in the knob's phases). Without mirrors (`wb_notes_off`: Intel's integrated GPUs, `RX_VK_MIRROR=0`) or with `RX_VK_WB_REPORTS` set no report word is noted: the switch is not read or logged and the four counts stay 0. The `RX_VK_LAB_AB` knob `nowordsseen` notes every word again in its phases. Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.106 ± 0.048 ms (1.4% fps), measured while the knobs `nocapgap` and `nobindspan` were still asked at every left-out check and every binding that may use a span, string compares that every knob's phases paid and the phases without a knob did not, so the figure is likely somewhat high (by an estimated 0.03-0.09 ms). The check run (all four scenes, every rider checked at once): 158,588 report words noted, 0 check mismatches |
| `RX_VK_WB_DIFF=0` | Write-backs copy every byte again instead of only what changed against a VRAM shadow (the diff is on by default; v2.0.9 and v2.0.10 had it off, issue 1161) |
| `RX_VK_LAZY_WB=1`, `=2` or `=0` | The lazy write-back for one run, over the Debug tab's Lazy write-back row (`lazy_write-back=1`; on by default since options_version 5; `docs/lazy-writeback.md`, `gpu/vk/wb_lazy_state.h`): a whole page of what shaders write into a mirrored pool that the CPU leaves alone is no longer copied back at every submission; its page has no access, and whoever touches it (the game's code or the host's, by a fault; a host call that hands it to the kernel; the GPU through the import) has it copied down first. Windows only. On AMD's driver the row alone leaves it off, as NX2navi did after games ended in play there; `=1` turns it on anyway. `=2` is the self-check: every copy is still made, the pages are protected and paid as if not, and each payment compares what it would have copied with guest memory: a `MISMATCH at guest` line is a page it would have got wrong. The log says `vk: lazy write-back on` (or why off) at the start, and every 600 submits `vk: lazy write-back (600 submits)`: the MB not copied, the pages owed, the pages paid by a fault, a host call, a GPU read, a mirror given up and a recording's submit, the payments and their time, and what failed |
| `RX_VK_LAZY_PAYERS=<1..4>` | (Triforce, 4 by default; `=1` as before) How many of the lazy write-back's payments copy at once (`gpu/vk/wb_lazy_payers.h`, NX2navi's `wb_lazy_unlocked`). A payment's copy goes onto the queue after everything submitted so far and its thread waits for it (0.5 to 3 ms each in the owner's sessions, up to 21 ms at a load); with one at a time, a second thread that touched another owed page, or the replay giving a mirror up, waited for the first one's copy to come back before its own went onto the queue. Each payment holds a slot of its own (a command buffer and a fence); the pages of two payments are never the same ones (`gpu/vk/wb_lazy_state.h`), and each copy still goes onto the one queue after everything before it. The 600-submit line `vk: lazy write-back (600 submits)` ends with the payments that waited for a free slot and the most slots in use at once |
@@ -401,18 +418,20 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_N64=<0..2>`, `RX_VK_N64_LINES=<n>`, `RX_VK_N64_LOD=<levels>`, `RX_VK_N64_TV=0\|1`, `RX_VK_N64_MASK=<0..4>`, `RX_VK_N64_FPS=<n>` | (Triforce) N64 Classic for one run, over the Insert menu's N64 Classic row and its Remembered page (`gpu/vk/n64_rules.h`, `gpu/vk/vk_n64.cpp`): 1 Faithful, 2 Remembered (its page's values), 0 off; unset, the row (F7 turns it on and off, but not while the switch is set). Its 3D pass takes every gameplay upscale network's place (`shaders/n64_3d.comp`): the 3D on a grid of 240 lines (480 for Remembered) as wide as the picture's shape, each grid pixel the mean of its footprint, Faithful's at 15-bit colour with the ordered dither, then out to the picture's size, linear along each line and hard between lines. While it draws, DLSS, FSR 3.1 and FSR 4 step aside (the game's own as far as they are concerned) and the game's SMAA is left out (`RX_VK_AA` still goes over that); not on a RenoDX run's RGBA16F scene. `RX_VK_N64_LINES` sets the grid's lines. (Step 3) The texture blur: the scene's tiled material textures sampled that many mip levels coarser (Faithful +2.5, Remembered +1.5, never past the card's `maxSamplerLodBias`), on the upscalers' scene-only path (not the shadow maps, the HUD or the output's passes); `RX_VK_N64_LOD=<levels>` over the preset's, `0` none. (Step 4) The TV at the window, in the filter's place at the window's own pixels, HUD and all (the FPS counter is drawn after it; the options' own screens go under it, below): the screen's curve, the composite colour bleed, the beam across 240 TV lines (wider where bright), the mask (Auto: the slot mask on a picture placed 1440 lines tall or more, none below), the glow from the picture at 1/8, the vignette; not on HDR Native's PQ picture, nor under DLSS frame generation, nor with `RX_VK_UPSCALE=0`. `RX_VK_N64_TV=0` leaves it out, `RX_VK_N64_MASK=<0..4>` (Auto, none, aperture grille, slot mask, shadow mask) picks the mask. (Step 7) The frame rate: Faithful 20, Remembered its page's Frame rate row; the renderer tells the host once a present (`HOS_OPT_N64_FPS`), which paces the game at it from the next frame, no restart (`host/n64_pace.h`, `host/nn_vi.c` `n64_pace_decide`): never above the Frame rate cap, never under 15, not while a movie plays, game time real time. `RX_VK_N64_FPS=<n>` over both presets (0 the cap's); `HOS_N64_PACE=0` keeps the cap's whatever the renderer says. The log says `vi: N64 Classic: frames paced at` at each change. (Step 8) At F7 or a change of the row, half a second of the TV switching off and on (the picture squashed to a bright line, then a dot, and opened again), the 3D, the TV and the frame rate changing at its middle (`n64_tick` once a present); not on HDR Native's picture nor under DLSS frame generation (the choice at once there), and not at a start. `RX_VK_N64_TV_ANIM=0`: the choice at once. (11-22) The options' own screens (the open menu, our tabs over the game's Options screen, the Mods entry) are drawn into a layer of the picture's place that the TV lays over the picture before its steps, so they bend, scan and bleed as the game's own screens under them (`vk_menu.cpp` `menu_tv_layer`, `vk_imgui.cpp` `record_layer`), and the glow's 1/8 copy is made again with them over the picture (else it blurred the game's own panes through their plates); the FPS counter, the notice and benchmark mode's panel stay over it, flat; with HDR on the options stay over it too (their pictures are in HDR10's codes, not the SDR picture's). The mouse is taken through the TV's curve to where the options and the game's own menus were drawn (`n64_rules.h` `screen_point`, `vk_n64.h` `n64_screen_point`; the game's through the renderer's `screen_point`). `RX_VK_N64_TV_MENU=0`: the options over the TV, flat, as before. The log says `vk: N64 Classic:` at its first grid and each new size |
| `HOS_EVIL_HD=0`, `=1`, `HOS_EVIL_HD_DIST=<1..4>` | (Triforce, Evil HD) Over the Graphics tab's Evil HD row (`evil_hd`, off unless chosen): on or off for one run, and how far its render distance goes, a factor from 1 to 4 (4 when not set; `1`: the game's distances, as before, with the row on). It draws the foliage farther: the grass and undergrowth (40 and 60 m as shipped), flowers and stones (35 m), the low trees of the distance (135 m) and their shadows (40 m), with the fades between the trees' levels, the factor times as far. They are the defaults of the game's foliage LOD settings (`game::foliage::ResLodSetting`, eight floats at main+0x3eefd38 that the game's parameter code reads by address when an area loads); `host/evil_hd.c` writes them each time the factor changes, after checking they are this game's. The foliage system builds an area's distances from them once a run, the first time it enters it, so the row applies from the start of a run (the menu asks to restart; a change mid-run reaches only the areas not visited yet). Seen 11-24 (headless, 1920x1080, Hyrule Field from the Market's drawbridge at noon): at 4x the grass tufts and small plants cover the meadows out to the ranch and up the hills, where off they stop at about 40 to 60 m; at 2.5x part of the way; with all eight at 0.5 m the ivy and grass by the Lost Woods bridge go. Cost there, uncapped on an RTX 5090 PC whose frame the CPU limits (20 s each): off 147 and 128 fps, 2.5x 128, 4x 124 and 123, about 0.8 ms a frame at 4x, the draws the same (about 2100). Areas whose data sets their own (the Graveyard, Zora's River and Domain, Hyrule Castle's flowers, Kokiri Forest handheld) keep theirs. Draw only, and not changed: the camera's far plane (25 km in play, near 0.1 m: not what limits the view; 1000 m is the title screen's camera), the model LOD coefficient (`game::gfx::ModelLodParam`: at 0.05 no visible change), the actors' presence radius (`DisplayRadius`, which creates and deletes them) and their update radius (`CalcRadius`). The log's `evil hd:` line says each change (`host/evil_hd.h`, `tests/test_evil_hd.py`) |
| `RX_VK_STUB_SAME_SIZE=0` | (Triforce, 11-22, the performance audit's GPUWORK-21, after Source B's and Source A's; `gpu/vk/stub_same_size.h`) On unless `0`. A gameplay upscale network that cannot run (left out or not translated: `RX_VK_NO_F16`, a card or driver that cannot build it) is stood in for by its input drawn into its output (`gpu/vk/vk_draw.cpp` `upscale_stub`) also where the two are one size: `9dc98871eb7fc101`, the network of Render resolution 100%, was declined as "no larger than its input" and skipped whole, a black 3D under the HUD. Both gameplay networks now take the typed upscale first (it reads the scene's shared-exponent picture and undoes the network's square-root encoding; it was the 3/4 network's alone), then the blit, which warns of wrong colours for both, then nothing. The picture is the upscaler Off's: softer, none of the network's anti-aliasing. Only where the network cannot run. `0`: the decline, and the 3/4 network alone in the typed upscale, as before. `RX_VK_NO_UPSCALE_STUB=1` still turns the whole stub off; `RX_VK_FORCE_UPSCALE_STUB=2` sends every network through it, for a look |
| `RX_VK_WIDE_UPSCALE=0` | (Triforce, 11-26; `gpu/vk/vk_draw.cpp` `wide_upscale`) On unless `0`. With RenoDX's RGBA16F scene and the game's own upscaler, the gameplay upscale below 100% (the 3/4 network at 75% and Auto, the networks of the other shares where they are left out) is drawn by the stand-in's pass, which squares the network's input (the square root of the scene colour) back, into an R11G11B10F image and from there into the picture. Without it the 3/4 network drew a black 3D and the plain blit of the others a 3D veiled in white. `0`: as before |
| `RX_VK_DLSS=0/1/2`, `RX_VK_DLSS_PRESET=<letter>`, `RX_VK_DLSS_LOG=1`, `RX_VK_REFLEX`, `RX_VK_REFLEX_LOG=1`, `RX_VK_ANTILAG=0/1` | NVIDIA DLSS and Reflex, and AMD Anti-Lag 2, for one run (`=-` on Reflex or Anti-Lag 2: its extensions not even enabled): the readme's NVIDIA DLSS section. `RX_VK_DLSS_TRACE=<frames>` logs one frame's large draws every that many frames, `RX_VK_DLSS_DEBUG=motion` shows the motion vectors, `=alternate` the game's own upscale every other frame |
| `RX_VK_FSR4=0/1/2`, `RX_VK_FSR_DIR=<folder>` | AMD FSR 4 for one run (0 never, 1 FSR 4, 2 its Native AA), and another folder for AMD's DLLs (not from `hookshot_env.txt`): the readme's AMD FSR 4 section. `RX_VK_FSR4=1/2` and `RX_VK_DLSS=1/2` go over the Upscaler row, a saved FSR 3.1 too where the engine they ask for runs; `RX_VK_FSR=1` goes over them (one upscaler at a time; `=2`: FSR 3.1 as its Native AA, the 3D at full size). The DLSS trace and debug switches above apply to FSR 4 too, on the frame chain they share |
| `RX_VK_XESS=0/1/2`, `RX_VK_XESS_DIR=<folder>` | Intel XeSS Super Resolution for one run (`gpu/vk/vk_xess.cpp`, Windows only): 0 never (Intel's `libxess.dll` not even loaded), 1 Intel XeSS, 2 its Native AA, over the Upscaler row as `RX_VK_FSR4` is (DLSS before FSR 4 before XeSS); and another folder for `libxess.dll` (else beside the executable, then the game folder). The DLL is the player's, from Intel's XeSS SDK: Triforce builds only against Intel's MIT API headers (`third_party/xess`), never links, ships or downloads it. With it there, the instance and the device are made with what XeSS asks for (a device refused with them is made again without, XeSS off for the run) |
| `RX_VK_FSR4_DRS=1`, `RX_VK_FSR4_AUTO_EXPOSURE=0` | (Triforce) AMD FSR 4's context as before, for comparing (`gpu/vk/vk_fsr4.cpp` `make_context`, `gpu/vk/temporal_rules.h` `plan_context`): `RX_VK_FSR4_DRS=1` one context with FSR's dynamic-resolution flag for every render size from the start, where a fixed Render resolution otherwise gets a context of its own size without it (and the game's dynamic resolution one with it once the size first changes); `RX_VK_FSR4_AUTO_EXPOSURE=0` its HDR contexts (Upscale before bloom, or an RGBA16F picture with RenoDX's HDR Native) without FSR's auto exposure. A creation or evaluation of DLSS or FSR 4 that fails leaves the game's upscale for 2 s and is tried again; the fourth failure in a row turns that engine off (the Upscaler row then shows Game and says so) until the row is set again |
| `RX_VK_SHARPEN_3D=0`, `RX_VK_FSR3_BOOST=0`, `RX_VK_UPSCALE_LOD_BIAS=0/<negative>` | (Triforce) For comparing with before (`gpu/vk/sharpen_rules.h`): the Sharpness row sharpens the 3D before the HUD with DLSS, DLAA, FSR 3.1 and FSR 4 (FSR 3.1's own RCAS, FSR 4's own sharpening, FSR 3.1's RCAS pass over DLSS's picture) and then nothing at the window; `RX_VK_SHARPEN_3D=0` the finished picture at the window for every upscaler, the HUD with it, as before. `RX_VK_FSR3_BOOST=0` FSR 3.1's sharpness the row's alone, without the share towards the most below three quarters of the output's width. `RX_VK_UPSCALE_LOD_BIAS=0` no texture LOD bias while DLSS or FSR scales the 3D with jitter (unset: log2(render / output) - 0.5 in quarters of a level, so -1.5 at Performance, -1 at Quality and -0.5 at the Native AAs, on the wrapping, mipmapped textures of the draws into the scene at the upscaler's render size (or, in the frame the dynamic resolution steps, at the size the scene's camera is drawn at), never the shadow maps, captures, other passes or dispatches; the log says `vk: texture LOD bias` at each change); a negative number, such as `RX_VK_UPSCALE_LOD_BIAS=-1` or `=-1.5`, that bias (-3 at most) in the same draws and only while an upscaler with jitter runs, for trying other values (the log says it once at the start) |
| `RX_VK_DLSS_BLENDED_MOTION=1` | (Triforce, 11-26) For comparing with before (`gpu/vk/vk_draw.cpp` `own_motion`): draws that blend over the scene (fireflies, glows, fog cards) are given a motion of their own for DLSS, FSR 3.1 and FSR 4, as before. Off by default: they keep the camera's motion, as the reactive mask expects (`gpu/vk/reactive_policy.h`); with their own, FSR 4 drew white rings and trails round the fireflies of Kokiri Forest (the owner's capture of the white lines). |
| `RX_VK_FSR4_MODEL=auto/lite` (or `0/1`) | Over the Graphics tab's FSR 4 model row for one run: Auto lets AMD's library pick the network for this GPU (as before), Lite forces its INT8 Lite network (`ffxProvider_FSR4Lite_Int8`). Only for the one upscaler library whose layout is known, FSR SDK 2.4's `amd_fidelityfx_upscaler_vk.dll` by its SHA-256 (`gpu/vk/fsr4_models.cpp` `kKnown`, the hash `scripts/fsr_sdk.py` pins): it is loaded from its full path before AMD's loader asks for it, and its providers' IsSupported answers are hooked in this process; any other file is neither loaded nor scanned, and the row is not shown. The row shows on AMD GPUs with FSR 4 as the Upscaler. A Lite context AMD refuses, or whose dispatch fails, is Auto for the rest of the run (the log says so) |
| `RX_VK_FSR4_STANDIN=1` | Where AMD's library lists no FSR 4 model for the GPU (another maker's GPU, or a Radeon AMD names none for) and the Lite provider is hooked (`RX_VK_FSR4_MODEL` above), the list is asked again with Lite answering: FSR 4 is then offered and every context runs INT8 Lite, with AMD's own shaders (the log: `INT8 Lite stands in`). Off unless set: FSR 4 stays off on such a GPU, as before |
| `RX_VK_FSR4_TUNE=1`, `RX_VK_FSR4_UNROLL=0` | AMD FSR 4's passes tuned as AMD's library makes them, on AMD GPUs (off unless set): the network's layers run 64 lanes wide, the weight tables the layers and the postpass copy into per-thread arrays are read from a tail of the library's storage buffer, and the small layers with weight tables are unrolled, built one at a time in the background (`gpu/vk/fsr4_tune.h`, `vk_fsr4.cpp`). Measured 8.97 -> 4.04 ms on an RX 6700 XT at 720p -> 1440p, bit for bit AMD's output on Adrenalin 26.10.1 (other drivers: the same maths, not necessarily the same bits). Where the library binds its buffer without the tail, or destroys it, AMD's own shaders are bound for that context and the log says so (`AMD's own shaders in place of the tuned ones`). `RX_VK_FSR4_UNROLL=0`: all of that but the unrolling. Frame generation's library is never tuned |
| `RX_VK_FSR4_FG=0/1/4` | AMD's frame generation, the Frame generation row's AMD FSR (`gpu/vk/vk_fsr4.cpp` `fsr4fg`): 0 never in this run (`RX_VK_FSR4=0` too, which keeps AMD's library unloaded); 1, as without it, the newest frame generation AMD's library lists for the card, FSR 4's where listed (RX 9000), else FSR 3.1's (3.1.6 on RX 6000 and 7000), the row naming it ("AMD FSR (3.1.6)") and the log the version in use; 4 FSR 4's alone, as before (FG-1) |
| `TRIFORCE_MENU_AHEAD=0` | (Triforce) What the options' rows ask of NVIDIA's and AMD's libraries (whether DLSS, FSR 4 and FSR 4's frame generation run here: NGX's start, AMD's loader) asked at the options' open on the presenting thread, as before, and not once on a thread of its own as soon as the game runs (`gpu/vk/vk_menu.cpp` `menu_ahead`; its log line says how long each took). For comparing: the first open waited about 2 s for them in test11 |
| `RX_VK_AA=<0..3>`, `RX_VK_AA_KEEP=1` | The anti-aliasing for one run, over the Insert menu's Anti-aliasing row: 0 the game's own SMAA, 1 none, 2 FXAA, 3 SMAA at its Ultra preset in its place (`gpu/vk/aa_rows.h`, `gpu/vk/vk_aa.cpp`). Unset, the row decides; with DLSS, DLAA or FSR drawing from the tone mapped picture (Upscale before bloom off) the game's SMAA is left out (none: they want jittered frames no other anti-aliasing has been over), and before the bloom it runs as the game's; the switch goes over both, for an A/B (`RX_VK_AA=0`: the game's SMAA under the upscaler). The game's SMAA is three compute programs known by their keys (game build `e0f3ccfa`): with another choice in effect its composition is replaced and its edge and weight passes are left out, and `RX_VK_AA_KEEP=1` keeps those two running. The log says `vk: aa:` when a composition is first replaced, why one was left to the game, and when none was found for a minute |
| `RX_VK_THREADED=0`, `=1`, `=auto` | (Triforce; **off by default**, the Debug tab's Threaded rendering row, Off, On or Auto, which this goes over for the run) The renderer's threads as one design (`gpu/vk/threaded_rendering.h`), each piece one Triforce has, driven from here: the replay on its thread (`RX_VK_ASYNC=1`), the recorder thread (`RX_VK_RECORDER=thread`) handed a part at a time (`RX_VK_RECORDER_PARTS`), a submission's parts ending where the game ends its render pass (`RX_VK_PART_MIN`, `RX_VK_PART_FIRST`, `RX_VK_PART_MAX`), the present thread (`RX_VK_PRESENT_THREAD`) asking for the next image right after each present (`RX_VK_ACQUIRE_AHEAD`). Each of those switches, when set, still goes over it. Auto: on from 4 physical cores in the process's affinity; with no buffer-pool mirrors the recorder thread alone from 6; off with `RX_VK_CAPTURE=0`, `RX_VK_LOW_SPEC`, `RX_VK_DUMP` or `RX_VK_BENCH`. `=0` (or the row Off): everything as before. The log's `vk: Threaded rendering:` line says what this run took. The lab's A/B is `RX_VK_THREADED=0` against `=1` |
| `RX_VK_THREADED=0`, `=1`, `=auto` | (Triforce; **off by default**, the Debug tab's Threaded rendering row, Off, On or Auto, which this goes over for the run) The renderer's threads as one design (`gpu/vk/threaded_rendering.h`), each piece one Triforce has, driven from here: the replay on its thread (`RX_VK_ASYNC=1`), the recorder thread (`RX_VK_RECORDER=thread`; since 11-27 not handed a part at a time, `RX_VK_RECORDER_PARTS` below), a submission's parts ending where the game ends its render pass (`RX_VK_PART_MIN`, `RX_VK_PART_FIRST`, `RX_VK_PART_MAX`), the present thread (`RX_VK_PRESENT_THREAD`) asking for the next image right after each present (`RX_VK_ACQUIRE_AHEAD`). Each of those switches, when set, still goes over it. Auto: on from 4 physical cores in the process's affinity; with no buffer-pool mirrors the recorder thread alone from 6; off with `RX_VK_CAPTURE=0`, `RX_VK_LOW_SPEC`, `RX_VK_DUMP` or `RX_VK_BENCH`. `=0` (or the row Off): everything as before. The log's `vk: Threaded rendering:` line says what this run took. The lab's A/B is `RX_VK_THREADED=0` against `=1` |
| `RX_VK_ASYNC=1` | The replay on a thread of its own instead of the game's submitting thread (off by default). The game still presents only once the GPU has run its frame, so nothing is released early. (Triforce, `gpu/vk/async_rules.h`; not yet run in the game) With it on, each with a switch of its own to put it back: a signal of the CPU's takes its capture on the game's thread only when a submission handed over before it may still wait for that event, which the host tells at the submit (`RX_VK_ASYNC_EVENT_NOTES=0`: at every signal while the thread has work, as before; the `vk: the replay thread: ... signals of the CPU's` line counts both); the submit's capture shares its copies with the copy helpers and has them all made before the hand-over (`RX_VK_ASYNC_CAPTURE_BEHIND=0`: every copy on the game's thread); the game's submit keeps its virtual core for the hand-over (`HOS_ASYNC_KEEP_CORE=0`: given up and taken again); the game's present poll waits for the replay thread asleep and looks at its event between yields only once the GPU has the frame (`HOS_PRESENT_POLL=0`: the game's own sleeps); a present runs the jobs behind it until the frame's stopped work has gone on and then makes go only what was already stopped at the present before (`RX_VK_PRESENT_DRAIN=1`: every present forces every stopped queue past its wait, as before; `=0`: none does; `RX_VK_PRESENT_WAIT_MS`, 8: how long it runs the jobs behind); and the thread looks for its next job for 100 µs before it sleeps (`RX_VK_ASYNC_SPIN_US=<0..1000>`). Still open, and why it stays off: after a ten-area tour the player's character is drawn black for one frame, 0 to 3 times a minute at the Market (`gpu/vk/async_rules.h` has what the lab ruled out). Two diagnostics for it: `RX_VK_LOG_READBACK_ZERO=1` logs each readback of GPU results that is all 0 where it was not at its readback before, and `RX_VK_REGION_TRAP=1` (with `RX_VK_PASS_TRACE=1` and the frame log) logs the passes of the last frames and writes their render conditions to `region_cond_<n>.txt` when the picture's bottom middle goes dark for a frame, eight times a run. `RX_VK_ASYNC_FORCED=1`: the thread as it was before 11-14, every catch-up forcing |
| `RX_VK_OCC_QUERY=0`, `RX_VK_OCC_QUERY_SKIP=<addr>[,...]`, `RX_VK_OCC_COND=0`, `RX_VK_OCC_LOG_COND=1`, `RX_VK_OCC_GATE=0` | (on by default since 11-17: +2.7 to +4.6% fps in every scene measured, 10-12% fewer draws, no flicker added; `RX_VK_OCC_QUERY=0` turns it off) The game's samples-passed reports (which objects show; a count of 0 is not drawn) get their real counts: the replay still writes each report as it passes it with 4096 (`RX_VK_OCC_FIXED`, everything visible), and the draws from its reset are counted by Vulkan occlusion queries (precise where the card has them); once the GPU is done with the recording that holds them the count is written into the report's record over the 4096, as NX2navi writes it at completion. The done recordings are found with one look at the recordings' timeline (nothing waits) as a game's fence wait ends (the game reads its counts after it), at each recording's begin and each present, at the latest when the recording's slot comes round. The game's report records rotate (a ring: an address is another object's at its next report), so a count is written only while its report is still the newest at its address, and only when it is whole (every query available, no draw left out, reset and report in one recording, read back within 8 presents); otherwise the record keeps its 4096. The game also predicates draws and clears on these words (render conditions), decided as NX2navi decides them: a word whose newest report is a samples-passed one whose count is still to come is unknown and the condition renders; a word whose count was written (or for which none comes) is read from memory as before, where a written 0 skips the draws and clears it gates. A count goes in only over the value the replay left in the word (a compare-and-write: never over the game's CPU re-arming the record), and a record rewritten in the stream after its report (a small buffer clear, a report of another counter type) gets no count. A parallel replay's segments signal the recordings' timeline and are sealed as they are submitted, so their counts are written too. The count word is written as the replay writes a report (`guest_cpu_write`, and the word kept out of the mirrors' write-backs). With hostQueryReset (Vulkan 1.2) a recording's queries are reset on the CPU once read, only those it used. `RX_VK_OCC_QUERY_SKIP`: report addresses that keep the fixed answer (the log's `occlusion query sites` lines list the first 64 addresses with their counts). The log's `occlusion queries` line every 600 presents: the reports, how many were counted whole and why not, the counts written at completion (and of them 0), those not written and why (lost, superseded by a later report at the address, late, a render condition's), the mean latency in presents and how many were written after the next present, where the done recordings were found, and the render conditions on samples-passed words (rendered because a count was pending, rendered or skipped from a written count, from memory with no count to come, as before in the knob's off phases) with the draws and clears they skipped. `RX_VK_OCC_COND=0`: a condition on a samples-passed word always renders (the counts are still written), to tell the counts from the skips. `RX_VK_OCC_LOG_COND=1`: one such condition in 499 logged (300 lines), with both words, their sources (pending, written, memory) and the present. (11-22) `RX_VK_OCC_GATE=0` turns off (on by default since its lab A/B: no fps lost at the Market): a count over a draw that a written count's condition left out (between the reset and its report) is the skip's 0, not the object's, and a condition on it renders; the count is still written for the game's CPU. Why: the game's CPU reads a count after its frame wait and draws a hidden object's proxy instead of the object, but most counts land after it has read the 4096, so it goes on drawing the object under the condition, the condition reads the skip's 0 and the object stays hidden (tickets 11-21: items and trees in the Forest Temple, black interiors; `RX_VK_OCC_QUERY=0` showed them). The line's second half counts these counts (counted whole, written, of them 0), the conditions that read one and those the switch rendered, on or off. Cost with it on: a hidden object under such a condition is drawn every other frame instead of never. Lab: the knob `occq` in `RX_VK_LAB_AB` runs the queries the whole run and writes the counts of the reports made in its phases (`gpu/vk/occ_answer.h`, `vk_replay.cpp` "occlusion queries") |
| `RX_VK_OCC_DEPTH_ONLY=1` | (Triforce, 11-22, the performance audit's GPUWORK-01, after Source A's; off unless set) Only the occlusion windows whose draws write no colour are counted. The game's occlusion tests draw depth only, but a query here opens at a window's first draw in the pass and stays open to the report or the pass's end, so it can enclose draws that write colour, and a query's end waits for the work it encloses. With the switch, a window's first draw that writes a colour target gives its count up: the open query ends before that draw, no query begins again until the next reset, and the report is incomplete, so its record keeps the 4096 placeholder and what it gates is drawn. Fewer objects are culled with it (Source A: 4% fewer for 0.25 ms of GPU time), never one missing; whether that pays here is for a measurement to say, which is why it is off. The lab's knob `occdepth` (`RX_VK_LAB_AB`) is the switch in its phases. Counted either way, in a third `vk: occlusion queries` line every 600 presents: the counting windows that met a colour draw, the colour draws recorded under an open query, the counts given up and the reports kept 4096 for it (`gpu/vk/occ_answer.h` `Counter::colour_draw`; `gpu/vk/vk_replay.cpp` `occ_draw_colour`; `gpu/vk/vk_draw.cpp` `draw`) |
@@ -422,11 +441,14 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_WAIT_HOLD_PAUSE_US=<us>` | (Triforce, 11-22, the performance audit's THREAD-11, after Source B's; off unless set, not measured here) A wait of the game's for a fence whose work is stopped at an event's wait holds up to `RX_VK_WAIT_HOLD_US` (3 ms) for another queue to let it on before it forces it, looking again and again: a flush, the timeline's value, the order lock to ask whether the stopped work is still needed, and a yield of the processor. With `<us>` (2 is Source B's; 1000 at most) a gap of PAUSEs that long stands between two looks instead of the yield, and the order lock is taken only when one of its sections has left since the waiter last asked, which is the only time its answer can change; the fence's own value is still read at every look, and the bound and the forced drain stay. Source B measured 59.2 to 59.9 fps and a 1% low of 40.0 to 42.1 with such a gap on a loop that runs far more often than this one (about 15 holds a second here). `0` or not set: as before. Either way the `vk: queues ordered by their events` report is followed by a `vk: fence waits held for stopped work` line: the holds, their looks, the time held, the takes of the order lock and how the holds ended (`gpu/vk/wait_hold.h`, `gpu/vk/vk_replay.cpp` `wait`) |
| `RX_VK_WAIT_HOLD_PAUSE_US=<us>` | (Triforce, 11-22, the performance audit's THREAD-11, after Source B's; off unless set, not measured here) A wait of the game's for a fence whose work is stopped at an event's wait holds up to `RX_VK_WAIT_HOLD_US` (3 ms) for another queue to let it on before it forces it, looking again and again: a flush, the timeline's value, the order lock to ask whether the stopped work is still needed, and a yield of the processor. With `<us>` (2 is Source B's; 1000 at most) a gap of PAUSEs that long stands between two looks instead of the yield, and the order lock is taken only when one of its sections has left since the waiter last asked, which is the only time its answer can change, or while a signal of the CPU's (`nvnEventSignal` without the replay thread) is queued and no section has acted on it yet; the fence's own value is still read at every look, and the bound and the forced drain stay. Source B measured 59.2 to 59.9 fps and a 1% low of 40.0 to 42.1 with such a gap on a loop that runs far more often than this one (about 15 holds a second here). `0` or not set: as before. Either way the `vk: queues ordered by their events` report is followed by a `vk: fence waits held for stopped work` line: the holds, their looks, the time held, the takes of the order lock and how the holds ended (`gpu/vk/wait_hold.h`, `gpu/vk/vk_replay.cpp` `wait`) |
| `RX_VK_INDEX_REBASE=0` | (Triforce, 11-21, the performance audit's DESC-12) A direct indexed draw binds its index buffer at offset 0 and gives its offset as the draw's first index, so draws at different offsets of one buffer bind it once: bound at each draw's own offset, nearly every indexed draw called `vkCmdBindIndexBuffer`. Only where the offset is a whole number of indices; indirect indexed draws are as before. `RX_VK_PROF_FINE=1` counts the index binds looked up and those made. `0`: every draw binds at its own offset (`gpu/vk/index_rebase.h`, `vk_draw.cpp` `draw`, `bind_index`) |
| `RX_VK_CAPTURE_PUSH_KEEP=0` or `check` | (Triforce, 11-26, the GPU audit's C15; `gpu/vk/capturepushkeep.h`, on by default) A plain draw's capture push (`vk_draw.cpp` `push_capture`: the 16 bytes that say where its vertex stage stores its positions, zeros when the draw is given no slot) is left out while its command buffer is known to hold zeros there for the program's push stages. With no temporal upscaler's chain asking for positions every draw pushed the same zeros: a `vkCmdPushConstants` a plain draw, about 2,000 a frame at Lake Hylia (1.7% of the Presentation Thread's samples there), each a packet for the recorder too. Only zeros are kept: a draw that is given a slot always pushes, and so does the first one without a slot after it. What is kept is the command buffer's own (`cmd_work.h` `CmdWork::cap`) and is forgotten centrally, never by a list of call sites, since an address left there would be written through: by every `vkBeginCommandBuffer`, every `vkCmdPushConstants` and every `vkCmdBindPipeline` of the renderer (`vk_work.h`'s macros) and every library's own recording into a command buffer (the recorder's `B_DIRECT` boundary); only the program path's own bind of a program with the same push stages takes it back, when the draw state was not reset before it. A program's whole push block (`push_constants`, zeros in those 16 bytes) marks them held after its push. `0`: pushed before every such draw, as before. `check`: pushed before every draw too, and the pushes the rule would have left out are counted, with those over bytes that a model of the pushes does not have as zeros (`vk: capture push check` lines name the first eight). The model and the rule are fed by the same `vk_work.h` calls, so that count is 0 by construction for every push and bind `vk_work.h` sees: it compares what `full_pushed` and `pushed` claim with the bytes pushed through `vk_work.h`, ignores binds, and is no evidence that a library's recording or a call past `vk_work.h` is covered. Those are held by the `B_DIRECT` boundary before each library call (`tests/test_recorder_sync.py`) and by the scan for calls past the macros in `tests/test_capturepushkeep.py`. Any other value: on (told once). The lab's knob `nocappush` (`RX_VK_LAB_AB`) pushes before every draw in its phases. `0` and the knob's phases still note every push and bind, so neither is v0.8.4's cost, and the measurement below is against the knob's phases, not against v0.8.4. The frame statistics' `a frame's capture pushes` line counts the pushes kept and made a frame (with the replay's helper threads those two counts can miss a few, as the frame statistics' other counts in `vk_draw.cpp` do; the check's must-be-0 count is exact). Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.195 ± 0.060 ms (2.6% fps). The check run (all four scenes, every rider checked at once): every push kept by the rule made too, 0 of them different (0 by construction, as above) |
| `RX_VK_RECORDER_OWN=0` | (Triforce, 11-21, the performance audit's REPLAY-04) With the recorder thread, a recording slot's descriptor pools are reset, its extra pools destroyed and its grown streams given back in `draw_begin_recording`, after the recording's first packets, as before: each is a boundary the replay waits at until the recorder has run what came before. The default makes that reset in `begin_recording` right after the slot's command pools are reset, where the recorder has nothing held. The 120-present line `a frame's recorder thread` counts the replay's waits (`gpu/vk/vk_draw.cpp` `draw_slot_reset`, `vk_replay.cpp` `begin_recording`) |
| `RX_VK_DESC_POOL_GROW=0`, `RX_VK_DESC_POOL_DIV=<1..32>`, `RX_VK_STREAM_MB=<MB>` | (Triforce, 11-22, the performance audit's DESC-33, after Source A's; `gpu/vk/desc_pool_grow.h`) Each recording slot (48 at most) keeps a descriptor pool for the programs over the push limit, and the driver may keep host memory for all of it 48 times. A slot's pool is made at half size (4096 sets, 16384 uniform buffers and sampled images, and so on) and made whole (8192 sets) at the slot's first reset after a recording ran out of it; a recording that runs out gets a whole extra pool on the spot, as it always did. `RX_VK_DESC_POOL_GROW=0`: whole pools from the start, as before. `RX_VK_DESC_POOL_DIV=<n>` divides both sizes by n. `RX_VK_STREAM_MB=<n>` is the size of each slot's first upload stream (2 by default; a recording that needs more is moved to a bigger one, kept for the slot's next 120 recordings; 24 with `RX_VK_STREAM_GROW_OFF=1`, which skips draws instead). Every 3000 recordings the log's two "the recording streams" lines say the most one recording held of its stream, how many slots are still at half, how many were made whole, the extra pools made, and the most sets and descriptors of each type one recording took: what a smaller default is judged by (the stream's stays 2 MB until those numbers are read in play) (`gpu/vk/vk_draw.cpp` `make_pool`, `slot_reset_locked`, `draw_begin_recording`) |
| `RX_VK_CAP_SPARE_FIT=0`, `RX_VK_CAP_STEP_MB=<n>` | (Triforce, 11-22, the performance audit's MEM-33; the first on by default, the second off unless set; not yet run in the game) `RX_VK_CAP_SPARE_FIT=0`: a capture with no spare buffer makes its own with the spares' lock held, takes any spare that fits, and a spare made ahead is made once, as before. Without it (`gpu/vk/cap_spare.h`, `gpu/vk/vk_memory.cpp` `cap_buf_get`) the buffer is made with the lock let go, so the replay's take does not wait behind a submitting thread's allocation to give a buffer back; where spares are not capped at 32 MB a capture leaves alone a spare of 32 MB or more that is over twice its size class, for the load that wants it; the spare a capture of a class of 32 MB or more takes is made again on a worker; a spare is made ahead only if it fits what spares may hold together with the ones held and being made, and a buffer given back counts the ones being made; when the allocation fails, any spare that fits, then the exact size. `RX_VK_CAP_STEP_MB=<n>`: where spares are capped at 32 MB (a card of 6.5 GB or less), a capture over 16 and up to 32 MB gets a buffer in steps of n MB, not the whole 32 MB (Source A: 4; its worst frames were worse in two pairs, so off here). The 600-take line counts the buffers made on a submitting thread and their ms |
| `RX_VK_MIRROR_PIECE_IDLE=<submissions>` | (Triforce, 11-22, the performance audit's MEM-26, its first step only; off unless set; not yet run in the game) A mirror in pieces keeps a piece's memory until the whole mirror goes, also where no game pool is left in its import. Giving such pieces back is NOT ported (the unbind and the free must wait for the GPU and for the bind timeline). What it would find is counted (`gpu/vk/piece_idle.h`): every 1200 submissions, after the `mirrors in pieces` line, the MB of pieces no game pool covers; with this switch each binding given a mirror in pieces also notes the submission in its pieces, and the line says how many of those MB no binding reached for that many submissions (600 is the wait the release would use). Under about 100 MB at the end of a tour on a 6 GB card (`RX_VK_TEST_CARD_MB=6144`) the release is not worth porting |
| `RX_VK_BIND_SPAN=0` or `check` | (Triforce, 11-26, the GPU pass on v0.8.3, C08; `gpu/vk/bindspan.h`; on by default; measured on v0.8.4 at the end of this row) Every buffer a draw binds goes through `gpu_buffer_bind`; a read binding its memo does not know (a per-draw uniform range is new at every draw) took the lock-free path each time: the thread's pool table, the pool's fields, an add on `Pool::binds`, the resident pieces' walk of a mirror in pieces, to find the mirror the binding before it in the same pool found (`gpu_buffer_bind` was 9.2% of the Presentation Thread's samples at Lake Hylia, 4.5% self). By default a thread keeps eight spans of guest addresses, each filled by a binding that path just gave the mirror: the pool, or with a mirror in pieces the run of resident pieces around the binding. A later read binding inside one is given the mirror at the same offset while the key stands: the bindings' stamp (a pool leaving, a mirror made or freed, a piece taken out of a mirror, the next submission), the pool table's generation, the thread's segment of a parallel replay, the recording and the times imports were left overlapping (below). The memo is asked first and written at a hit as before. Never from a span, the whole path as before: written bindings, bindings outside a submission's uploads or without mirrors, and with `RX_VK_LOG_MIRROR_USE`, `RX_VK_MIRROR_HEAT` or `RX_VK_MIRROR_PIECE_IDLE` set (each acts at every binding). No span either for an import made beside the imports it overlaps (`pool_lookup`'s plan to take them in would pass 1 GB) or for those imports: a page then has two imports, its bindings go by the page, and a span of either would answer for the other's pages too (`Pool::left_overlapping`). A span's hits are added to `Pool::binds` (a logged average) when the span is replaced, and dropped when the pool table changed. `=0`: no spans, as before. `=check`: every hit is also resolved the whole way, the whole way's result is returned and the differences are counted and the first 20 logged with the span and its key; a checked hit is counted as checked, not as answered from a span. Any other value: spans, as unset, and logged. The lab's knob `nobindspan` (`RX_VK_LAB_AB`) is `=0` in its phases (read once a submission, not at every binding). Every 600 submissions, with mirrors: `vk: bind spans (600 submits): <n> read bindings answered from a span, <n> the whole way past the memo, <n> spans filled`, with `=check` also `checked against the whole way so far <n>, <n> differed`. Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.099 ± 0.056 ms (1.3% fps), measured while the knobs `nocapgap` and `nobindspan` were still asked at every left-out check and every binding that may use a span, string compares that every knob's phases paid and the phases without a knob did not, so the figure is likely somewhat high (by an estimated 0.03-0.09 ms). The check run (all four scenes, every rider checked at once): 31,196,849 span hits resolved the whole way too, 0 different |
| `RX_VK_RANGE_WALK=0` | (Triforce, 11-22, the performance audit's MEM-42; on by default; not yet run in the game) The capture and collection loops (`gpu/vk/vk_memory.cpp` `memory_collect_written`, `capture_make`'s staging and behind loops, `take_capture`'s loops over the texture storage's ranges) ask of every page whether it lies in a sorted range list with a binary search, as before. Without it each loop has a cursor that only moves forward (`gpu/vk/range_walk.h`), one pass over the ranges for the loop; an address below the last one asked searches again, so any order gives the search's answers (`tests/test_range_walk.py` compares them). The `RX_VK_LAB_AB` knob `norangewalk` searches in its phases |
| `RX_VK_CAP_UNION_SHARED=0`, `=check` | (Triforce, 11-26, the GPU audit's C22; on by default; measured on v0.8.4 at the end of this row) `=0`: each caller of the captures' range lists builds its own union of them, as before. The captures take the pages of the mirrored imports (clipped to the game's pools, `RX_VK_CAP_ONLY_GPU`), the texture storage and the small pools; `capture_make` (a submit's capture) and `capture_ranges_merged` (the replay's collection) each kept their union behind a version of their own, so the Presentation thread, which does both in the plain mode (with threaded rendering the game's submitting thread does one and the replay thread the other), built it twice at every change of a list: three sorts over ~4400 ranges, two clips, and the left-out ranges published again, which has every thread copy them again (profiled at the Market: `capture_union_locked` 2.2% of that thread). By default (`gpu/vk/capunion.h`, `gpu/vk/vk_memory.cpp` `capture_union_take_locked`) the union is built once each time a list changes (`cap_ranges_ver`, under `cap_ranges_mu`) and copied by the callers into their own lists, the left-out ranges are published at that one build, the sorts are merges of the runs that arrive sorted (each run is asked, and sorted when it is not), and the pool table's look (`refresh_pool_ranges_locked`) no longer makes its map of the pools' first captures unless `RX_VK_CAPTURE_EAGER` reads it. The lists are the same vectors as before (`tests/test_capunion.py` compares them over random lists with `RX_VK_CAP_ONLY_GPU` 0, 1 and 2). `=check`: the lists are built both ways, the old ones used, and a reused union is compared with one built again (the first captures' map is skipped as by default: without `RX_VK_CAPTURE_EAGER` it changes no list); the differences are counted and the first 20 logged (0 expected). The `RX_VK_LAB_AB` knob `nocapunion` builds as before in its phases. Counted in the log's "capture (RX_VK_CAP_ONLY_GPU" line every 10 s ("the captures' union of the lists (RX_VK_CAP_UNION_SHARED=M): built N times, copied from one built N, built by a caller for itself N, runs that had to be sorted N, check differences N", M being 1, 0 or check; the first four over the last 10 s, the check differences since the start; not printed with `RX_VK_CAP_ONLY_GPU=0`). Any other value of the switch: one union a version, as unset, and logged. Expected: about 0.05 ms a frame at Lake Hylia and 0.08 ms at the Market, from the profiles' shares, before the measurement below. Measured on v0.8.4 (11-27; RTX 5090, 2560 x 1440, the camera held at Kakariko Village for 300 s with the replay thread alone, `RX_VK_PARALLEL=0`; the knob's phases against their neighbours, 95% interval): 0.227 ± 0.066 ms (3.0% fps), measured while the knobs `nocapgap` and `nobindspan` were still asked at every left-out check and every binding that may use a span, string compares that every knob's phases paid and the phases without a knob did not, so the figure is likely somewhat high (by an estimated 0.03-0.09 ms). The check run (all four scenes, every rider checked at once): 0 differences between a reused union and one built again |
| `RX_VK_TABLE_STREAM=0` | (Triforce, 11-22, the performance audit's SYNC-04; on by default; not yet run in the game) The guest page table's changes of a recording (the table the shaders' pointers go through, `gpu/vk/vk_memory.cpp` `memory_table_flush`) are flushed as before: a (page, value) pair for every page changed, all of them sorted, the last of each page kept: 16 bytes a page and a sort on the recording thread, a few ms when a pool of hundreds of MB is imported ahead or merged. Without it the changes are streamed (`gpu/vk/table_stream.h`): runs in page order and apart are appended one after the other, any other set is swept by page with the newest change owning each page, through one reused batch of 8,192 entries. The transfers are the same ones in the same order (`tests/test_page_table_stream.py` compares the two, entry for entry). A flush over 1 ms is logged with its pages, changes and transfers (the first 16) |
| `RX_VK_CAPTURE_BEHIND=0` | (Triforce, on by default; `=0` as before) The submit-time capture (`gpu/vk/vk_memory.cpp` `capture_make`) takes the write marks on the game's submitting thread and copies there only the pages read at once (the late pages and the texture storage); the rest of its copies, in parts of 32 pages, go to the capture's copy helpers while that thread replays the submission (`gpu/vk/capture_behind.h`). A read of a page as submitted copies its part itself when no helper has taken it yet, or waits for the helper; every part is done and flushed before a recording is submitted and before the thread goes back to the game. Only with the replay on the submitting thread (not `RX_VK_ASYNC=1`), with copy helpers (`RX_VK_CAPTURE_THREADS`, not `RX_VK_LOW_SPEC`), at least 128 pages behind and at most 512 ahead (a scene's load: copied whole as before). At the Market the old copy was ~0.25 ms of each submit's ~0.35 ms capture, six submits a frame. The 120-present line `a frame's captures at the game's submits` gives their time on the game's threads (the scan, the copies made there, and the copies behind made or waited for by the replay), the MB copied and behind, and who copied the parts; the stall line names the captures when they took 1 ms or more |
| `RX_VK_CAP_FREE_ASYNC=0` | (Triforce, on by default; `=0` as before) A retired capture buffer the spares cannot keep (past 12 buffers or 768 MB, 32 MB on a card of 6.5 GB or less) is destroyed on a thread of its own (`gpu/vk/vk_memory.cpp` `cap_buf_free`, `destroy_buffer_later`), not in the capture's take on the replay's thread with its locks held: freeing a 64-256 MB host-cached buffer makes the driver unmap and release every page, the `retires` part of a `vk: slow capture take` line. Only buffers the GPU is done with get there; the memory comes back a moment later. The 600-take line counts the buffers and MB handed over. With no thread to be had they are destroyed where they were retired |
@@ -434,7 +456,7 @@ case-sensitive, and an unknown one is ignored.
| `RX_VK_PARALLEL_BACKOFF=0` | The tuner's trials as before: one every 1,800 presents after one that kept the way, each with 104 frames the other way. With the back-off (the default, `gpu/vk/replay_threads.h` `Tuner`) each trial that keeps the way, the other way longer than both of its own parts, puts the next one off twice as long (3,600, 7,200, then 14,400 presents at most; a margin of 10% or more counts twice), one too close to tell keeps the old interval (the first such one after a change of scene or way: 900 presents), and once the way has held so the other way is tried for 64 frames, not 104; a short trial that finds the other way shorter changes nothing itself, a full trial follows at once. The next trial comes early (900 presents after the last one at the soonest, never while the rule says no trial) when the scene clearly changes: two windows of 120 frames in a row whose draws moved by a quarter (200 at least) or whose replay or GPU time moved by 30% (1 ms at least) from the first window after the way was set, or a trial whose first and last parts did. In the lab's steady Market a trial came every ~2,090 presents, each ~100 frames 1.9 ms longer; the trial lines now end with when the next may come, and `parallel replay, the scene changed` says when one was brought forward |
| `RX_VK_TUNER_SETTLED=0` | The tuner's rule judges every window and a trial the scene changed under decides, as before. With settled scenes only (the default, `gpu/vk/replay_threads.h` `Tuner`, after Kaefergeneral's #dev-fixes post: on his 5900X and RTX 3090 the rule turned the helper threads on in an area's load and the first trial after the arrival kept them, and Automatic was 6 to 10% slower than Off) the rule judges a window of 120 frames only if the one before it describes the same scene (its draws within a quarter, 200 at least, its replay and GPU times within 30%, 1 ms at least: the back-off's test), so a load's window and the first after it get no verdict and the rule's "on" comes a window after a scene settles; a trial whose first and last parts moved so changes nothing, either way, and the next comes 120 presents after a window like the one before it, not 900 or more later. The trial's line says so (`the scene changed under it`), and `parallel replay, the scene settled` when the next is set. Between trials the scene is calm while two windows in a row of the way in use describe one scene: a trial due waits for a calm scene (900 presents at most), none begins where nothing is cut (a loading screen), and after a trial the scene moved under the next is never more than 900 presents late. The rule's "on" holds only for the scene it judged: the first window that moved from the first with the helper threads on takes them back off (`the rule's "on" withdrawn`), and the rule judges the new scene; and the rule's "on" needs three windows in a row, each within those margins of the first of them (an arrival whose texture load comes down a little each window passes two alike, not three) |
| `RX_VK_RECORDER=thread`, `=defer`, `=sync`, `=off` | (unset: `thread` on an NVIDIA GPU with 12 logical processors or more, and on an AMD GPU with 6 physical cores or more in the process's affinity but for AMD's Windows driver for RX 5000 and RX 6000 (`gpu/vk/recorder_auto.h`); else off. The log's `vk: recorder thread on/off by default` line says which rule applied; `RX_VK_LAB_AB=norec` makes the calls directly in its phases, to measure it) `thread`: the replay thread's `vkCmd*` calls packed with copies of their arguments into a ring and made by a recorder thread of their own, in order (`gpu/vk/vk_recorder.h`); the replay thread waits for it at every command buffer begin, end and reset, submit, wait, readback and destruction. Beside the Replay helper threads too (no longer refused with `RX_VK_PARALLEL`): a parallel replay's segments make their calls themselves, after the ring has been run (`segments_begin`), and the recorder is idle while they record. With it on, the frame statistics' `a frame's recorder thread` line says how many of the replay's calls it made a frame and in how long, and how long the replay thread waited for it; what it saves is the replay time line's `commands` with it against without it. `defer` and `sync` are its test steps (held and run on the same thread). `RX_VK_RECORDER_RING_MB` (8), `RX_VK_RECORDER_SPIN_US`, `RX_VK_RECORDER_STATS=0`, `RX_VK_RECORDER_POISON=1`, `RX_VK_RECORDER_PIN` (`next`, `sibling` or a mask) |
| `RX_VK_RECORDER_PARTS=0`, `=1`; `RX_VK_RECORDER_IDLE=wait` | (Triforce; unset: on with Threaded rendering (`RX_VK_THREADED`), so **off by default**) The recorder thread handed a part at a time (`gpu/vk/vk_recorder.h` `post_part`, `gpu/vk/vk_replay.cpp` `part_submit`): the replay publishes a part's packets at its end (256 KB chunks of a long one) and puts the part's two `vkEndCommandBuffer` and its queue submit into the ring as one more packet, which the recorder makes in order, so the replay goes on into the next part at once; a slot's reuse waits for its own part, a fence or timeline wait for the parts handed over (at most its own time), a thread about to take the queue's lock for them first (`QueueMutex`, `gpu/vk/vk_internal.h`), and a holder of a queue lock never for a recorder waiting for that lock; the recorder waits on its ring between batches (WaitOnAddress). Not for a recording with upload pieces or with the lazy write-back (made on the replay's thread, as before). A `vk: recorder, by part` line with the stats line. `=1`: with any recorder thread; `=0`: as before. `RX_VK_RECORDER_IDLE=wait` (opt-in): the recorder waits on its ring after a 20 µs spin without the hand-off too |
| `RX_VK_RECORDER_PARTS=0`, `=1`; `RX_VK_RECORDER_IDLE=wait` | (Triforce; **off unless `=1`**. Threaded rendering turned it on until 11-27: with it the 3D was drawn with wrong textures on an RX 7900 XT, black characters and white leaves, in v0.8.3 too, and without it the picture was right at Off's frame rate. The fault in the hand-off is not found yet) The recorder thread handed a part at a time (`gpu/vk/vk_recorder.h` `post_part`, `gpu/vk/vk_replay.cpp` `part_submit`): the replay publishes a part's packets at its end (256 KB chunks of a long one) and puts the part's two `vkEndCommandBuffer` and its queue submit into the ring as one more packet, which the recorder makes in order, so the replay goes on into the next part at once; a slot's reuse waits for its own part, a fence or timeline wait for the parts handed over (at most its own time), a thread about to take the queue's lock for them first (`QueueMutex`, `gpu/vk/vk_internal.h`), and a holder of a queue lock never for a recorder waiting for that lock; the recorder waits on its ring between batches (WaitOnAddress). Not for a recording with upload pieces or with the lazy write-back (made on the replay's thread, as before). A `vk: recorder, by part` line with the stats line. `=1`: with any recorder thread; `=0`: as before. `RX_VK_RECORDER_IDLE=wait` (opt-in): the recorder waits on its ring after a 20 µs spin without the hand-off too |
| `RX_VK_REPLAY_PRIO=0` or `1` | (Triforce, on by default, after NX2navi's `recorder_prio`; `=0` as before) A thread runs at the highest priority while it replays the game's frames (the submitting thread's replay and its capture, the present, the stopped work the order thread lets on: `gpu/vk/vk_replay.cpp` `ReplayPin`) and gets its own priority back after, so the game's code it runs between replays keeps the game's priority; the core kept for the replay is kept from the game's threads only, and the helper threads and the capture's copy helpers (above normal) outranked a replay at the game's priority there. A thread at that priority or above already is left alone. The replay thread of `RX_VK_ASYNC=1` and the recorder thread of `RX_VK_RECORDER=thread` take the level for good. `=1`: above normal. The log's `vk: a thread that replays runs at` line says which (`gpu/vk/replay_prio.h`) |
| `RX_VK_REPLAY_PIN_SOFT=0`, `=2` | (Triforce, 11-22, the performance audit's THREAD-09, after Source A's; Windows) A thread is pinned while it replays to the core the host keeps for the replay, and that core is kept from the game's threads, not from other programs': where another program's high-priority thread holds it, the pinned replay waits for it, ready to run (Source A, a 6+8-core hybrid processor with an overlay service at priority 15: 14 to 37 frames over 40 ms in a 40 s run, none with this). Not set: on a processor with cores of more than one kind the pin is soft: the thread may run on the reserved core and on the fastest-kind cores among its own processors, the reserved core's last logical processor is its ideal one, and the core it is on when the pin starts is left out so that it moves at once; its affinity and ideal processor come back after the replay. The replay thread of `RX_VK_ASYNC=1` gets the same processors for good. A processor of one kind of core keeps the strict pin, and nothing changes there. `0`: the reserved core alone everywhere, as before; `2`: soft everywhere (the lab; the knob `pinsoft` of `RX_VK_LAB_AB` does it by phases). A thread of another program that wakes on the core every millisecond moves the replay again and again (Source A: 54.3 against 44.6 fps, one run each): `0` is for that. The log's `vk: a replay's pin is` line says which (`gpu/vk/replay_pin.h`, `gpu/vk/vk_replay.cpp` `ReplayPin`, `replay_pin_soft`) |
| `HOS_VCORES=0`, `HOS_CORES=<1..8>`, `HOS_RESERVE_CORE=0` | No virtual cores; the cores the game sees (6); no core kept for the replay (one is, with 8 or more logical processors) |
@@ -457,6 +479,7 @@ case-sensitive, and an unknown one is ignored.
| `A64_SUB_V=1`, `A64_SUB_V=ovf` | (Triforce; read when the game is translated, and in the lift key; off by default) The translator writes a flag-setting subtraction's V flag (SUBS, CMP, CCMP) from the bits of its operands and result, and the game's signed conditions (LT, GE, GT, LE) read it against N: seven to nine host instructions a compare, which the compiler does not fold. `1` writes V as N xor (a < b, signed), the same bit for every operand, which the compiler folds to one host compare and jump. It adds a `<` to every function that compares, and the hot pieces' recorded profile is matched to a function by a count of such things: record a new profile with it. `ovf` writes V as the compiler's own overflow test of the subtraction (`__builtin_sub_overflow`): five instructions a signed compare, and the recorded profile still matches. `nx2/cmpflags.py`; `tests/test_cmpflags.py` runs both forms against the translator's text. |
| `RX_MARK_BITMAP=1` (build), `HOS_MARK_BITMAP_ALL=1` (run) | (Triforce; read by `nx2/build.py`: a full rebuild; off by default) Every store of the translated game also marks its memory page, so that the renderer finds what the game changed; the renderer reads only the marks of the pages the GPU can reach, and most stores are to other memory. With `RX_MARK_BITMAP=1` a store marks only when its first byte is on a page whose bit is set in a bitmap (`host/mark_bitmap.c`): the pages of every GPU mapping and native pool, and the page before each, set when the mapping is made and never cleared. A mark missed is stale data drawn, so compare pictures before shipping it. In such a build `HOS_MARK_BITMAP_ALL=1` sets every bit at the start, so every store marks as before (the control of an A/B). `tests/test_mark_bitmap.py`. |
| `A64_FASTFP=1`, `=hot`, `=check`; `A64_FASTFP_MIN=<n>`, `A64_FASTFP_STORES=0`, `A64_FASTFP_VMOVES=0` (lift); `HOS_NO_FASTFP=1` (run) | (Triforce; read when the game is translated, and in the lift key; off by default) Fast float regions (`nx2/fastfp.py`). Each single-precision float op of the translated game carries its own exactness tests, about 25 instructions around one SSE op. With `A64_FASTFP=1` a straight run of instructions holding at least `A64_FASTFP_MIN` (8) such ops is written twice: a fast copy of plain SSE ops between one MXCSR clear and one read, and the exact copy as before, which runs instead, with the run's registers put back, when the fast copy raised an invalid, denormal or underflow flag. A run may hold guest stores (made after the check passed; `A64_FASTFP_STORES=0`: a store ends a run) and the vector moves of `nx2/fastvec.py` (`A64_FASTFP_VMOVES=0`: they end a run). `hot`: only the hot functions. `check`: both copies every time, the exact one's result kept and the two compared (`fastfp check:` lines in the log). A function that holds an address the game's patches name gets no region, and the lift stops if a patch changes a function that has one. In a build lifted with it, `HOS_NO_FASTFP=1` runs the exact copies only. It changes the text of every function with a region (3,651 of them, 268 of the 849 hot ones in the supported game): record a new profile for the hot pieces with it. `tests/test_fastfp_override.py`, `test_fastfp_regions.py`, `test_fastfp_fma.py`. |
| `A64_LOCAL_FLAGS=0` | (Triforce, 11-23, the fps pass's LX-2, after NX2navi 0.11.0-rc4's `recomp/flags.py`; read when the game is translated, and in the lift key; on by default) A lifted function keeps N, Z, C and V in locals (`nx2/local_flags.py`, the kit's `A64_LOCAL_FLAGS`): read from the context once at its start and written back only where control leaves other than by a call or a return (a tail call, an indirect jump, an SVC, a trap), as the AAPCS64 leaves the flags undefined across calls and returns. Before, every flag a later instruction read was a byte stored into the context at each compare, which the compiler must keep. `0`: the flags in the context, as before (the game is translated again once); any other value keeps them as locals, and the lift prints which form it wrote (`flags: ...`). With the kit's `A64_PACKED_FLAGS` set as well the lift stops: that experiment writes the four flags into the context in one store, which the locals do not see. A scalar FCMP's fast path is lifted in the control flow the shipped hot profile was made from (`local_flags.profile_form`: the flags from the fast compare, then the exact one under `if (!_fk)`): clang finds a hot function's profile entry by a hash of its control flow, and the kit's own code form (`if (_fk) ... else ...`) left 652 of v0.8.4's 1384 hot functions, 17.7% of the profile's entry counts, built without theirs (11-27). The shipped hot profile has no records of the helpers this form calls (`a64_fcmp32k`, `a64_fcmp64k`), so their branches are built without its counts until the profile is recorded again with the switch on. `tests/test_local_flags.py` runs six functions (one float and hot) lifted both ways from the same states and compares clang's control-flow hash of each; `nx2/test_leaf.py` lifts with it. On v0.8.3 (11-23, 2560 x 1440, the Market after the save's load, the last 40 s of each run, nine runs a side interleaved over three batches, built with the shipped hot profile made without it): 139.4 -> 141.3 fps (+1.3%), the time a frame spends outside the replay 2.10 -> 1.98 ms; in the last batch, with the threads' times, 139.3 -> 142.3 fps (+2.1%, every run with it above every run without), and the game's workers and main thread 31.9 -> 30.4 ms of CPU a frame (-4.4%); on v0.8.4 (11-27, RTX 5090, 2560 x 1440, with the profile form; against the branch's riders and part size): the four benchmark scenes with the camera held, six runs a side in ABBA order, 150.0 -> 150.7 fps (+0.5%, not significant: the replay binds this PC's frame, p50 and p99 the same); with the camera turning as shipped, four runs against three, +0.8%; the Market held for 40 s, four runs a side in ABBA order with the threads' times, 139.9 -> 141.8 fps (+1.3%), the game's workers and main thread 23.6 -> 22.5 ms of CPU a frame (-4.6%) and all the process's threads 43.9 -> 42.5 ms (-3.1%, every run with it below every run without). The kit's own FCMP form, its hot functions without their profile, measured about 2% slower than the profile form |
| `HOS_HEAP_COMMIT=1` | (Triforce, 11-21, the performance audit's MEM-09) On Windows the game's heap (~6.9 GB asked for at its start) is left reserved and committed as it is touched, 64 KB at a first touch, by the handler that commits pages nothing handed out; committed whole, all of it counted against RAM plus the page file, touched or not. A fault another thread's commit answered is tried again, a commit refused at Windows' commit limit is tried again for 5 s, and a file read or write reads each page of its buffer once before the kernel's call, which faults nothing in. The log says `heap: left reserved` and counts the heap's first touches. `1`: all of it committed at the start, as before; so it is in large pages (`HOS_LARGE_PAGES`) and on Linux (`host/heap_commit.h`, `mkw_glue.c` `commit_on_touch`, `hos_mem.c` `SetMemoryHeapSize`) |
| `RX_VK_DMABUF_NVIDIA=1`, `RX_VK_NO_DMABUF=1`, `RX_VK_DMABUF_PIECE_MB=<n>` | (Linux) Where the game's memory is a memfd, each pool of it is offered to the driver as a dma-buf made by udmabuf, larger pools as several of at most udmabuf's limit bound into one sparse buffer; the log's `vk: guest memory as dma-bufs:` line says yes or why not. `RX_VK_NO_DMABUF=1`: host-pointer imports only. `RX_VK_DMABUF_PIECE_MB=<n>`: pieces of at most n MB. (Triforce, 11-22, the performance audit's OS-08, after Source A's; not yet run on Linux) NVIDIA's proprietary driver refuses every such dma-buf and the pool ends as a host-pointer import anyway, after a refused import each (up to 198 ms for one during a load) and a kernel message at each start: with that driver none is offered, `/dev/udmabuf` is not opened, and the line says `no (NVIDIA's driver refuses them: host pointers)` (`gpu/vk/dmabuf_gate.h`). NVK and RADV keep their dma-bufs. `RX_VK_DMABUF_NVIDIA=1`: offered to NVIDIA's driver too, as before |
| `HOS_COMMIT_WAIT_MS=<ms>` | (Triforce, 11-22, the performance audit's OS-04, after Source A's and Source B's; 5000 unless set) How long a refusal at Windows' commit limit (RAM and the page file full, error 1455) is waited out, tried again every 50 ms: such a refusal often ends in moments, as a page file set to grow grows or commit is given back. The game's own commits waited so already (the row above); now the host's own tables do too (a failed allocation there ended the game at once: `host/host_alloc.h`, `hos_xmalloc` in `host/mkw_glue.c`), and the renderer's failed `new`, which was an uncaught `std::bad_alloc`: its new handler sleeps 50 ms and lets the allocation be tried again, up to this long a thread, but only while the system has less than 4 GiB of commit left (a `new` refused with more free is not the limit's and throws at once), and not for the few allocations that have their own answer to a refusal (`gpu/vk/new_wait.h`, `gpu/vk/vk_main.cpp` `new_refused`). The log has `refused ... made after N ms` for the first rescues. `0`: no wait anywhere, a refusal fails at once; 60000 at most |
@@ -482,6 +505,7 @@ case-sensitive, and an unknown one is ignored.
| `HOS_VCORE_SPIN_US=<us>`, `HOS_VCORE_SPIN_MAX=<n>` | (Triforce, on by default; `HOS_VCORE_SPIN_US=0` as before) A game thread that waits for a virtual core it asked a holder to give up spins for it, up to 250 us, before it sleeps (`host/hos_thread.c` `vc_spin`, after NX2navi's `core_take`): the holder gives the core up at its next checkpoint, mostly within microseconds, and the waiter then runs without an OS wake. Who gets a core does not change, only how soon. At most `HOS_VCORE_SPIN_MAX` threads spin at once and the rest sleep at once: by default a quarter of the logical processors beyond 8, at most 4 (none with 8 or fewer, 1 with 12, 2 with 16). The `vcores:` line (every 5 s) counts the waits that ended in the spin and those that slept, the time spun, the spins left out for the cap, and how soon a granted core ran after a spin and after a sleep; the start's `vcores: a waiter spins up to` line says what is in effect. A yield with no thread waiting for a core takes no lock (NX2navi's yield fast path) |
| `HOS_VIDEO_ACQUIRE_TRIES=1`, `HOS_VIDEO_KEEP_CORE=1` | (Triforce, on by default; each `=1` as before) A movie's Acquire (`host/nn_video.c` `dec_acquire`) waits for a picture up to 100 ms by the clock, and not at all after a Stop or Flush with nothing submitted since: the old wait, 50 sleeps of 2 ms that each took 4-5 ms on Windows, ran out only after ~250 ms once a movie had stopped, a frame that long at every load from the title. It also decodes without the calling thread's virtual core, taken back only after the decoder's lock is let go, so other game threads run meanwhile. `HOS_VIDEO_ACQUIRE_TRIES=1`: the 50 sleeps; `HOS_VIDEO_KEEP_CORE=1`: the core held throughout |
| `HOS_VCORE_WIDE=1` | (Triforce, 11-22, the performance audit's GAME-22, after Source B's; off unless set, never measured there or here) A game thread whose core mask names two or more cores takes any free virtual core, not only those. Source B's reason: the game's two main threads may run on two of three cores only, where per-core job workers of better priority preempt them while the other cores stand idle. A thread with a one-core mask, which guards the game's lock-free per-core data, or with no mask, stays where it was; no two threads ever run under one core number either way. The risk is the one `HOS_VCORE_ANY=1` (every thread on any core, which crashed) has, for fewer threads: a thread that reads its core number, blocks and goes on under another. The log's `vcores: ... asks for ideal core ... and core mask` lines name every thread whose mask has two or more cores (all masks when the switch is set to anything): with no such line the switch changes nothing (`host/hos_thread.c` `vc_allowed`, `core_mask_note`) |
| `HOS_VIDEO_DECODE_AHEAD=0`, `=<2..14>` | (Triforce, on by default; `=0` as before) A movie's pictures are decoded ahead of the game by a host thread of the decoder's own (`host/nn_video.c` `decode_ahead_main`: not a game thread, so no virtual core and no guest memory; normal priority), which keeps 12 pictures queued, so `Acquire...DecoderOutputBuffer` takes a picture that is there instead of decoding it in the call (3-13 ms each for the title screen's 1080p AV1 movie, single ones 80-200 ms, and up to 728 ms in one call when the catch-up decoded several: the movie stuttered wherever a scene loads over it). `=<2..14>`: that many pictures ahead; a 1080p picture is 3.1 MB as NV12 (Media Foundation's; six are ~19 MB) and 11.4 MB with the RGBA libavcodec's pictures are kept with. The decoder's lock is not held across a decode, so a submit, an acquire and a flush never wait for one behind it; a flush waits for the decode in flight and throws away what it gives, the close ends the thread first; a full queue makes the thread wait, it never drops a picture; the catch-up skips queued pictures only and decodes nothing in the call. An acquire still waits when no picture is queued and one is on its way. `=0`: no such thread, the pictures are decoded in the call. The log's `video: N pictures taken` line says which, how many acquires found their picture ready and how many waited for it, and the longest wait; the `video: AV1 decoder` line at the start says so too. `tests/test_video_decode_ahead.py` |
| `RX_VK_HELPER_SPIN_US=<us>` | (Triforce, on by default; `=0` as before) The parallel replay's spins (`gpu/vk/helper_spin.h`, after NX2navi's replay workers): a helper thread with no segment to record spins up to 100 us for the next before it sleeps, and the replay thread spins as long for a segment a helper records before it sleeps for it. The frame statistics' `its spins` line, after the parallel replay's parts, says how often each ended in the spin or slept and the time spun |
| `HOS_X3D=0` | (Windows) The game's threads and the replay's core are not kept on the die with the largest L3 cache. By default they are (the replay's core only where one is kept there: `HOS_RESERVE_CORE`), on a processor whose L3 caches differ in size and whose largest serves 8 or more cores (AMD's two-die X3D parts: a 7950X3D's or 9950X3D's 3D V-Cache die; `host/hos_x3d.h`), and the log's `cpu: logical processors ... share the largest L3 cache` line says so. On every other processor nothing changes and the log has no such line |
| `HOS_X3D=0` | (Windows) The game's threads and the replay's core are not kept on the die with the largest L3 cache. By default they are, on a processor whose L3 caches differ in size and whose largest serves 8 or more cores (AMD's two-die X3D parts: a 7950X3D's or 9950X3D's 3D V-Cache die; `host/hos_x3d.h`), and the log's `cpu: logical processors ... share the largest L3 cache` line says so. On every other processor nothing changes and the log has no such line |
@@ -515,12 +539,15 @@ A build reads and writes tens of gigabytes. When the game folder or the build fi
| `HOOKSHOT_MINGW=<dir>`, `HOOKSHOT_MSVC=1` | The llvm-mingw to build with; the Visual Studio route instead |
| `HOOKSHOT_WORK_LOCK=0` | (Triforce, 11-22, the performance audit's IO-47) `make_game.py` takes no lock on its work folder, as before. By default it holds an OS lock on `<work>/make_game.lock` for as long as it runs (`msvcrt.locking` on Windows, `flock` elsewhere), taken after an earlier build left running is stopped and before the stale objects go: a second build on the same folder stops at once with the first one's process id instead of compiling the same objects again and racing on the staged game folder, which nothing prevented on Linux (two builders, a builder beside the launcher, `--cli`). The lock ends with its process, so a build that crashed never blocks the next; an error other than "held by another" is said and the build runs without the lock (`nx2/make_game.py` `lock_work`) |
| `HOOKSHOT_SINGLE_INSTANCE=0` | (Triforce) Hookshot Builder takes no lock on its build tools, as before. By default a second builder for the same tools folder (`builder/HookshotBuilder/Instance.cs`, named after `Tools.Root`), its `--cli` included, waits up to 5 s for one that is ending, then says so and ends: two of them built into one work folder and stopped each other's build. Triforce Setup has its own lock (`setup/Guard.cs` `Instance`) |
| `TRIFORCE_OOTRR_EXE=<file>` | (Triforce, 11-25) The launcher's Randomizer page runs this program as OOTRR, in place of the pinned release it downloads into `randomizer\ootrr\<version>` (`launcher/Logic/Randomizer/Ootrr.cs`): a developer's own build of OOTRR, or a test's stand-in (`LogicTests` copies itself in as `ootrr.exe`). Taken only in a test run (`TRIFORCE_TEST_ROOT`), a local build (version `dev`) or with `TRIFORCE_DEV=1`, as it runs any program |
| `TRIFORCE_OOTRR_URL=<url>` | (Triforce, 11-25) Where the Randomizer page downloads OOTRR's release file from, in place of its GitHub release (a test's own server). The file must still have the size and SHA-256 that `Ootrr.cs` pins. Moving to another OOTRR release means changing `Ootrr.Version` and the pinned files' size and hash (from its `SHA256SUMS.txt`; `gh attestation verify <file> --repo ootrando/ootrr`) |
| `OOTRR_E2E=<ootrr.exe>\|<game folder>` | (Triforce, 11-25) `LogicTests` runs the real OOTRR against a built game folder's `romfs` (read in place through a junction; seeds are written only in the test's own folder): every OOTRR preset either builds or is refused by the check before Make, and a seed's settings string reads back as its settings. Skipped without it |
| `TRIFORCE_LEGACY_PATHS=1` | (Triforce) Triforce Setup keeps .NET Framework's legacy path checks, which refuse paths of 260 characters and more whatever its manifest says (an exe csc builds is taken as written for .NET 4.0). By default `setup/Setup.cs` `Main` sets the two switches 4.6.2 defaults to (`Switch.System.IO.UseLegacyPathHandling`, `Switch.System.IO.BlockLongPaths`) before any path is used, so that with Windows' own LongPathsEnabled on Setup reads and writes deep paths |
| `HOOKSHOT_SEGMENT_HEAP=0` | (Triforce, Windows; on by default since 11-22: the lab's play A/B, 81.4 against 80.6 fps) The exe's manifest asks for Windows' segment heap (`heapType SegmentHeap`, Windows 10 2004 and newer) for the whole process, its DLLs and the graphics driver too, in place of the NT heap, whose lock AMD's driver's compile threads waited on through the shader preparation (`nx2/win_manifest.py`, `tests/test_segment_heap.py`). The heap is fixed when the process starts: a build with it and one without are the two arms. `0`: the NT heap, as before. The log's `the shaders' preparation runs on` line names the process heap (`segment` or `NT`) |
| `RX_CPM=<dir>`, `WGPU_NATIVE=<dir>` | The CPM cache (Vulkan and SPIR-V headers, VMA, FFmpeg) and wgpu-native |
| `RX_TARGET=windows` | On Linux: the Windows game, with llvm-mingw's Linux build in `HOOKSHOT_MINGW` |
| `RX_RELEASE=1` | A release build (`make_game.py` sets it): no console window, the shaders prepared before the title |
| `RX_VK_PGO=gen`, `=<file>`, `=0`; `RX_VK_PGO_FILE=<path>` | (Triforce, 11-21, the performance audit's LIFT-10) A play profile for the renderer's own code (`gpu/vk/*.cpp`; not the vendored recompiler, ImGui or zstd). `gen`: a build whose renderer counts its branches; run it with `RX_VK_PGO_FILE=<path>`, make `<path>.reset` once the scene to record is loaded and `<path>.dump` at its end, then `llvm-profdata merge -o work\triforce_vk.profdata <path>`. `<file>`: built with that profile (its contents are in the object keys, its path is not). Not set: `make_game.py` passes `work\triforce_vk.profdata` when the tools have one and the compiler can read it; `0`: none. A profile from another version of the renderer is taken function by function, the changed ones built without it. Record it again for each release, and compare against `RX_VK_PGO=0` before shipping one (`nx2/build.py` `vk_pgo_flags`, `host/pgo_rt.c`) |
| `RX_VK_PGO=gen`, `=<file>`, `=0`; `RX_VK_PGO_FILE=<path>` | (Triforce, 11-21, the performance audit's LIFT-10) A play profile for the renderer's own code (`gpu/vk/*.cpp`; not the vendored recompiler, ImGui or zstd). `gen`: a build whose renderer counts its branches; run it with `RX_VK_PGO_FILE=<path>`, make `<path>.reset` once the scene to record is loaded and `<path>.dump` at its end, then `llvm-profdata merge -o work\triforce_vk.profdata <path>`. `<file>`: built with that profile (its contents are in the object keys, its path is not). Not set: `make_game.py` passes `work\triforce_vk.profdata` when the tools have one and the compiler can read it; `0`: none. A profile from another version of the renderer is taken function by function, the changed ones built without it. Record it again for each release, and compare against `RX_VK_PGO=0` before shipping one (`nx2/build.py` `vk_pgo_flags`, `host/pgo_rt.c`). (11-27, measured on v0.8.4) A change to a hot function is enough: the GPU pass's replay riders change `draw()`, `memory_cpu_owned` and `rec::boundary`, so v0.8.4's profile no longer matches them and they are built at plain -O2. Built so, that branch (the riders, the part size and LX-2) measured +0.1% fps against v0.8.4 (the four benchmark scenes, camera held, four runs a side); with a profile recorded on it the same way as v0.8.4's, +1.7% (p99 frame time 8-14% lower either way). The build hides the mismatch (`-Wno-profile-instr-out-of-date`): compiling a renderer file with `-fprofile-instr-use=<the profile>` and that warning on says how many of its functions the profile no longer matches |
| `RX_PGO=gen` or `RX_PGO=<file>` | The hot code counting its branches for a profile, or built with one (`make_game.py` passes the shipped profile) |
| `A64_HOT_STICKY=0` | (Triforce, 11-22, the performance audit's LIFT-30, after Source A's; read when the game is translated, and in the lift key) `nx2/split_hot.py` deals the hot functions out afresh and gives every hot piece code_hot.c's whole preamble, as before. By default `<work>\image\hot_pieces.txt` keeps each hot function's piece: the next translation leaves the functions it knows where they were and puts a new one in the piece it shares the most calls with, else in the cheapest, unless that makes the costliest piece more than 1.15 times a fresh split's (then the split is the fresh one); and each piece keeps only the declarations of `f_` and `hos_` names it uses. An update that changes a few hot functions then compiles one or two hot pieces of about ten MB again, not up to eight. The functions' text is the same either way, and the hot profile goes by function name, so it fits both. The file is not in the lift key (`tests/test_sticky_hot_pieces.py`) |
| `RX_COLD_OPT=O2` or `=<file>`, `RX_COLD_PART_MB=<n>` | (Triforce, 11-22, the performance audit's LIFT-17, after Source A's; opt-in) The hot pieces are compiled at -O2 with the play profile and every other lifted chunk at -O1. `RX_COLD_OPT=O2`: every other lifted chunk at -O2 too; `=<file>`: only the chunks the file lists, one file name a line (`code_012.c`). Unset, empty or `O1`: as before. Each -O2 chunk is compiled as parts of `RX_COLD_PART_MB` MB by the lift's own estimate (6 when unset; `0`: no cut), cut only where a function begins and written under `<build>/split` with a key file a chunk, so a second build writes nothing (`nx2/cold_parts.py`, `tests/test_chunk_parts.py`): -O2's time grows with the square of a function's size. The lifted files themselves are not touched. Source A's figures: +4.4% and +5.5% fps where the game's update bounds the frame, for about twice the lifted compile's processor time (23 minutes against 5 without the cut); not built or measured with this game. The names begin with `RX_`, so setting them translates the game again once |