Renderer port 2 (VICTORY_PORT_DESCRIPTORS=1): fallback counts ~140 unreported view records/frame with all 6 stores patched; writer= field and WARN throttle mislead #338

Closed
opened 2026-11-26 20:50:02 +00:00 by github-bot · 4 comments
Owner

@⁠adrianmjim on GitHub · 2026-11-26 20:47 UTC · original

Low priority. This only affects the opt-in VICTORY_PORT_DESCRIPTORS=1 path, which exists only on a-publier and rx9070xt (both at cd8dfc0). main (4f62c2a) has no port_descriptors.rs or descriptor_sites.rs.

Setup: RX 7900 XT (RDNA3), AMD driver 32.0.32029.2010, Windows 11 build 26300, 32 GB RAM. a-publier cd8dfc0, cargo build --locked --profile diag -p victory --features diagnostics, victory run ... --console series-s. Settings were the scripts/play.ps1 defaults plus VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1 and VICTORY_PIPELINE_BOOK=1. This was the first run of the build with cold pipelines, so gameplay ran at about 3 fps.

Observed (from the log)

  • The startup log shows 6 of 6 descriptor record stores of the title patched. The heap is start=0xd780000 count=1245184 stores=6. At 32 B per slot that is 38 MiB, or 608 pages of 64 KiB.
  • Even so, the fallback (port_descriptors.rs:227-331) keeps finding view records that no mark reported:
    • The first miss is at 20:20:49, at under 1/frame. Until 20:21:40 the rate stays at or below about 26/frame. It climbs to 35-106/frame by 20:22:00, then stays mostly between about 20 and 309/frame until the run ended at 20:24:37.
    • The median per frame is 122.5 over the 166 summaries from the first miss, and 140.75 over the 135 gameplay summaries from 20:21:40. The max is 309. Late in the run, each port-2 summary covers 4 frames (from the cumulative deltas).
    • The final summary says 71308 view records missed, against 27349921 slots told (about 0.26%).
  • About 21% of the missed records were in tables that draws read (the of them of draws' tables field). The draw makes those anyway. See the counting caveat in point 6.
  • The memcpy/memmove hook (port_descriptors.rs:339-399) was added in 4cb90be for this same gap (its comment says "~250 view records a frame"). It shows 0 records they marked in all 224 summaries, while the title made up to 6754 memcpy/memmove calls per frame into the heap. In this run the hook closes none of the gap.
  • Cost from the first miss:
    • Fallback: median 0.65 ms per frame, mean 1.66 ms. Spikes were 14.6, 61.6, 24.3, 27.3, 10.5, 7.4 and 5.6 ms, between 20:21:45 and 20:23:10.
    • Taking the marks costs another 0.84 ms per frame (median).
  • The fallback budget is saturated (16.0 pages looked at whole) in 120 of the 166 summaries after the first miss.

Problems in the code / log

1. Some misses may be false positives (inferred from code, not measured).

  • In one sync pass, take() first clears the marks (descriptor.rs:431). Then the fallback pages are added as more parts (descriptor.rs:444-446).
  • Nothing removes marked runs that fall inside a checked page. Both kinds of part run in parallel on the victory-records pool (land.rs:347-354, 6 threads by default).
  • If the check part compares a slot before the run part does, missed() sees marked() as false, because the mark was already taken. A record that a patched store did report is then counted as missed.
  • The overlap also breaks the Copied contract that callers keep parts "apart from one another" (host.rs:4784-4797). changes() updates last-seen while it compares, so two overlapping parts race on the same slots inside an unsafe contract.
  • Each stub also stores before it marks (descriptor_sites.rs:86-107), which leaves a small window. Writes do happen during sync: up to 1069/frame told and not taken yet.
  • So 71k is an upper bound on the records that truly came from an unpatched store.

2. writer= does not name the record's writer.

  • faulted() is called from watch.rs:3833 only when a fault opened the block. It overwrites one value per 64 KiB block with that fault's RIP. So the value is the first write to the block since the guards were last re-armed.
  • missed() reads it later (line 316), so the value can come from a fault after the record was written.
  • Faults handled by titlewrite::store (watch.rs:3810), or skipped by try_read (line 218), never update it.
  • The doc comment says "last faulted", so the label is honest. It just does not help find the missing store.
  • Evidence:
    • The writers 0x7ffae9520000, +0x40, +0x80 and +0xc0 sit 0x70000 below the title image (mapped at 0x7ffae9590000). From address arithmetic, these are most likely descriptor_sites stubs 0-3 (inferred):
      • console_insn::near probes in 1 MiB steps below the first site, and this is the first spot below the image.
      • Each stub is the store plus 53 bytes plus a 5-byte jump, rounded up to 64 (descriptor_sites.rs:86-107,172).
      • Each stub starts with the store.
      • Those stubs do mark their slots, so this fits point 1.
    • The top writer, 0x7ffc69f3c26f (21051 of 71308 by the end), is outside the title image and its DLLs. I did not map it to a module.

3. Possible seventh store (a lead only).

  • title+0x4d9f25f (27 WARNs) and title+0x4d9f26e (17 WARNs) lie close to the patched graphics table filler at +0x4d9efd0.
  • Neither is in the SITES windows (descriptor_sites.rs:43-56).
  • They may be another record store whose code shape the site search does not match. Because of point 2 this is only a lead. It would explain only a small share (44 of 3394 logged WARNs).

4. Fix-ups can come later than EVERY frames, and not all are made "now".

  • VICTORY_PORT_DESCRIPTORS_EVERY=8 (lines 227-232) only sets how often the write watch is asked.
  • to_check (lines 276-294) drains the page set round-robin at 16 pages/frame, and that budget is saturated. With up to 608 pages queued, a page can wait about 38 more frames. The worst case is about 46 frames (from code).
  • The WARN says "made now", but not every missed record is made in the same pass (descriptor.rs:548-562, host.rs:945-949):
    • Draw-table records are left to the draw (COPIED_FRAMES=8). The draw makes the view it reads through a table at record time (draw.rs:3380-3399).
    • CONSTANT and PLACED views wait COPIED_GRACE=4 more frames.

5. The WARN throttle resets with every summary.

  • n = CHECKED[1].fetch_add (line 314) is gated by n < 20 || n.is_power_of_two() (line 323), but line() swaps CHECKED[1] to 0 (line 434).
  • The result was 23-26 WARN lines per busy summary and 3394 in total. A global "20 + powers of two" would have printed about 32.
  • The code never says the limit is meant to be global, so this is probably unintended rather than certainly a bug.
  • The 3394 WARNs name 3370 distinct slots. That is only a sample: the log cannot give the unique count over all 71k misses.

6. The tabled count includes records that were told. CHECKED[5] is incremented (lines 303-306) before the marked() early return (lines 309-313). So of them of draws' tables can be larger than the missed count, and it is in 8 summaries. For example, at 20:22:45 the summary shows 70.75 missed, 390.75 tabled and 721.0 told-and-not-taken.

  • placed unordered texture view not mirrored (null: writes through it are lost) (host.rs:4507-4533) logged 13 times, with times going from 1 to 4096.
    • Every line has address=0x0.
    • The resource formats are BC1, BC3 and BC7 variants, if the field uses DXGI numbering.
    • BC formats cannot be UAVs in D3D12, so these look like placeholder views (inferred), and "writes through it are lost" probably overstates it.
  • buffer view not on an element of its host copy fired once from each site. In both cases the offset is not a multiple of the element size, so the view is made null:

Not tested

  • No visual A/B with and without VICTORY_PORT_DESCRIPTORS=1.
  • No warm-pipeline run. This one was at about 3 fps, so per-frame rates at normal speed may differ.
  • I have not measured how many misses are false positives under point 1.

Possible fixes (outline)

  • Drop or trim marked runs that fall inside a checked page, or remove the check pages' slots from the runs before the jobs start. Either way the parts stay disjoint, as Copied requires.
  • Count tabled records after the marked() check.
  • Give the WARN throttle its own counter that line() never resets.
  • Optionally, record the RIP per slot (or per 4 KiB) on a fault rather than per 64 KiB block, so writer= comes closer to the record's writer.

On this RDNA3 machine I can rerun with a patch that keeps parts disjoint and compare the miss count. I can also try VICTORY_PORT_DESCRIPTORS_CHECK=64 to see how much of the delay comes from the page budget.

**@⁠adrianmjim** on GitHub · 2026-11-26 20:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/338) Low priority. This only affects the opt-in `VICTORY_PORT_DESCRIPTORS=1` path, which exists only on `a-publier` and `rx9070xt` (both at cd8dfc0). `main` (4f62c2a) has no `port_descriptors.rs` or `descriptor_sites.rs`. **Setup:** RX 7900 XT (RDNA3), AMD driver 32.0.32029.2010, Windows 11 build 26300, 32 GB RAM. a-publier cd8dfc0, `cargo build --locked --profile diag -p victory --features diagnostics`, `victory run ... --console series-s`. Settings were the `scripts/play.ps1` defaults plus `VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1` and `VICTORY_PIPELINE_BOOK=1`. This was the first run of the build with cold pipelines, so gameplay ran at about 3 fps. ### Observed (from the log) - The startup log shows `6 of 6 descriptor record stores of the title patched`. The heap is `start=0xd780000 count=1245184 stores=6`. At 32 B per slot that is 38 MiB, or 608 pages of 64 KiB. - Even so, the fallback ([port_descriptors.rs:227-331](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/port_descriptors.rs#L227)) keeps finding view records that no mark reported: - The first miss is at 20:20:49, at under 1/frame. Until 20:21:40 the rate stays at or below about 26/frame. It climbs to 35-106/frame by 20:22:00, then stays mostly between about 20 and 309/frame until the run ended at 20:24:37. - The median per frame is 122.5 over the 166 summaries from the first miss, and 140.75 over the 135 gameplay summaries from 20:21:40. The max is 309. Late in the run, each port-2 summary covers 4 frames (from the cumulative deltas). - The final summary says `71308 view records missed`, against `27349921 slots told` (about 0.26%). - About 21% of the missed records were in tables that draws read (the `of them of draws' tables` field). The draw makes those anyway. See the counting caveat in point 6. - The memcpy/memmove hook ([port_descriptors.rs:339-399](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/port_descriptors.rs#L339)) was added in 4cb90be for this same gap (its comment says "~250 view records a frame"). It shows `0 records they marked` in all 224 summaries, while the title made up to 6754 memcpy/memmove calls per frame into the heap. In this run the hook closes none of the gap. - Cost from the first miss: - Fallback: median 0.65 ms per frame, mean 1.66 ms. Spikes were 14.6, 61.6, 24.3, 27.3, 10.5, 7.4 and 5.6 ms, between 20:21:45 and 20:23:10. - Taking the marks costs another 0.84 ms per frame (median). - The fallback budget is saturated (`16.0 pages looked at whole`) in 120 of the 166 summaries after the first miss. ### Problems in the code / log **1. Some misses may be false positives (inferred from code, not measured).** - In one sync pass, `take()` first clears the marks ([descriptor.rs:431](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor.rs#L431)). Then the fallback pages are added as more parts ([descriptor.rs:444-446](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor.rs#L444)). - Nothing removes marked runs that fall inside a checked page. Both kinds of part run in parallel on the `victory-records` pool ([land.rs:347-354](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/land.rs#L347), 6 threads by default). - If the check part compares a slot before the run part does, `missed()` sees `marked()` as false, because the mark was already taken. A record that a patched store did report is then counted as missed. - The overlap also breaks the `Copied` contract that callers keep parts "apart from one another" ([host.rs:4784-4797](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor/host.rs#L4784)). `changes()` updates last-seen while it compares, so two overlapping parts race on the same slots inside an `unsafe` contract. - Each stub also stores before it marks ([descriptor_sites.rs:86-107](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-loader/src/descriptor_sites.rs#L86)), which leaves a small window. Writes do happen during sync: up to 1069/frame `told and not taken yet`. - So 71k is an upper bound on the records that truly came from an unpatched store. **2. `writer=` does not name the record's writer.** - [`faulted()`](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/port_descriptors.rs#L214) is called from [watch.rs:3833](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/watch.rs#L3833) only when a fault opened the block. It overwrites one value per 64 KiB block with that fault's RIP. So the value is the first write to the block since the guards were last re-armed. - `missed()` reads it later (line 316), so the value can come from a fault after the record was written. - Faults handled by `titlewrite::store` (watch.rs:3810), or skipped by `try_read` (line 218), never update it. - The doc comment says "last faulted", so the label is honest. It just does not help find the missing store. - Evidence: - The writers `0x7ffae9520000`, `+0x40`, `+0x80` and `+0xc0` sit 0x70000 below the title image (mapped at `0x7ffae9590000`). From address arithmetic, these are most likely descriptor_sites stubs 0-3 (inferred): - `console_insn::near` probes in 1 MiB steps below the first site, and this is the first spot below the image. - Each stub is the store plus 53 bytes plus a 5-byte jump, rounded up to 64 (descriptor_sites.rs:86-107,172). - Each stub starts with the store. - Those stubs do mark their slots, so this fits point 1. - The top writer, `0x7ffc69f3c26f` (21051 of 71308 by the end), is outside the title image and its DLLs. I did not map it to a module. **3. Possible seventh store (a lead only).** - `title+0x4d9f25f` (27 WARNs) and `title+0x4d9f26e` (17 WARNs) lie close to the patched graphics table filler at `+0x4d9efd0`. - Neither is in the `SITES` windows ([descriptor_sites.rs:43-56](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-loader/src/descriptor_sites.rs#L43)). - They may be another record store whose code shape the site search does not match. Because of point 2 this is only a lead. It would explain only a small share (44 of 3394 logged WARNs). **4. Fix-ups can come later than `EVERY` frames, and not all are made "now".** - `VICTORY_PORT_DESCRIPTORS_EVERY=8` (lines 227-232) only sets how often the write watch is asked. - `to_check` (lines 276-294) drains the page set round-robin at 16 pages/frame, and that budget is saturated. With up to 608 pages queued, a page can wait about 38 more frames. The worst case is about 46 frames (from code). - The WARN says "made now", but not every missed record is made in the same pass ([descriptor.rs:548-562](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor.rs#L548), host.rs:945-949): - Draw-table records are left to the draw (`COPIED_FRAMES=8`). The draw makes the view it reads through a table at record time (draw.rs:3380-3399). - CONSTANT and PLACED views wait `COPIED_GRACE=4` more frames. **5. The WARN throttle resets with every summary.** - `n = CHECKED[1].fetch_add` ([line 314](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/port_descriptors.rs#L314)) is gated by `n < 20 || n.is_power_of_two()` (line 323), but `line()` swaps `CHECKED[1]` to 0 ([line 434](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/port_descriptors.rs#L434)). - The result was 23-26 WARN lines per busy summary and 3394 in total. A global "20 + powers of two" would have printed about 32. - The code never says the limit is meant to be global, so this is probably unintended rather than certainly a bug. - The 3394 WARNs name 3370 distinct slots. That is only a sample: the log cannot give the unique count over all 71k misses. **6. The tabled count includes records that were told.** `CHECKED[5]` is incremented (lines 303-306) before the `marked()` early return (lines 309-313). So `of them of draws' tables` can be larger than the missed count, and it is in 8 summaries. For example, at 20:22:45 the summary shows 70.75 missed, 390.75 tabled and 721.0 told-and-not-taken. ### Minor related log items (also on main, in an older form) - `placed unordered texture view not mirrored (null: writes through it are lost)` ([host.rs:4507-4533](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor/host.rs#L4507)) logged 13 times, with `times` going from 1 to 4096. - Every line has `address=0x0`. - The resource formats are BC1, BC3 and BC7 variants, if the field uses DXGI numbering. - BC formats cannot be UAVs in D3D12, so these look like placeholder views (inferred), and "writes through it are lost" probably overstates it. - `buffer view not on an element of its host copy` fired once from each site. In both cases the offset is not a multiple of the element size, so the view is made null: - unordered, [host.rs:4043](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor/host.rs#L4043) (`offset=9 element=32`) - shader, [host.rs:3922](https://github.com/Belobug/VIctory-Belobug-AMD/blob/cd8dfc0/crates/victory-gpu/src/descriptor/host.rs#L3922) (`offset=9 element=4`) ### Not tested - No visual A/B with and without `VICTORY_PORT_DESCRIPTORS=1`. - No warm-pipeline run. This one was at about 3 fps, so per-frame rates at normal speed may differ. - I have not measured how many misses are false positives under point 1. ### Possible fixes (outline) - Drop or trim marked runs that fall inside a checked page, or remove the check pages' slots from the runs before the jobs start. Either way the parts stay disjoint, as `Copied` requires. - Count tabled records after the `marked()` check. - Give the WARN throttle its own counter that `line()` never resets. - Optionally, record the RIP per slot (or per 4 KiB) on a fault rather than per 64 KiB block, so `writer=` comes closer to the record's writer. On this RDNA3 machine I can rerun with a patch that keeps parts disjoint and compare the miss count. I can also try `VICTORY_PORT_DESCRIPTORS_CHECK=64` to see how much of the delay comes from the page budget.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:50:02 +00:00
Author
Owner

@⁠nerdjb on GitHub · 2026-11-26 20:51 UTC · original

it work bro
@⁠echo off
setlocal
rem ---------------------------------------------------------------------------
rem Best-known settings for the Series S profile on an RX 9070 XT.
rem run-GTA6-safe.cmd the fork's default profile, no experiments
rem test-setup.cmd checks this install without starting the title
rem ---------------------------------------------------------------------------
set "VICTORY_CONFIG=E:\Games\XSX\emu\belobug\victory.toml"
set "TEMP=E:\Games\XSX\temp"
set "TMP=E:\Games\XSX\temp"
if not exist "%TEMP%" mkdir "%TEMP%"

rem --- the fork's default profile (scripts\play.ps1, no -Safe) ---
set "VICTORY_TEXTURE_NO_WAIT=1"
set "VICTORY_RELAY=2"
set "VICTORY_WIDE_BACK=1"
set "VICTORY_CARD_REHASH_RUNS=1"
set "VICTORY_JOIN_COPIES=1"
set "VICTORY_INDIRECT_WINDOW=1"
set "VICTORY_RELAY_COPY=1"
set "VICTORY_CARD_STEPS=2"
set "VICTORY_INDIRECT_BATCH=2"
set "VICTORY_MAP_THREADS=1"
set "VICTORY_TITLE_PRIORITIES=0"
set "VICTORY_CARD_AWAKE=1"
set "VICTORY_SHOW_AFTER=1"
set "VICTORY_AMBIENT=0.8"
set "VICTORY_D3D12_DRED=light"
set "VICTORY_UNDER_WIDE=0"
set "VICTORY_LAND_ECHO=0"
set "VICTORY_THIN=1"
set "VICTORY_JOIN_PARTS=8"
set "VICTORY_UPLOAD_AHEAD=1"

rem --- Series S profile: 1080p output ---
set "VICTORY_OUTPUT=1920x1080"

rem --- renderer ports 1, 2, 4, 5 and 7 of docs/findings.md ---
set "VICTORY_PORT_CONSTANTS=1"
set "VICTORY_PORT_DESCRIPTORS=1"
set "VICTORY_PORT_CBV=1"
set "VICTORY_PORT_GUARD=1"
set "VICTORY_PORT_JOURNAL=1"

rem --- record the pipelines this run creates, so precache.cmd warm can
rem build them ahead of the next one ---
set "VICTORY_PIPELINE_BOOK=1"

rem --- small title buffers' copies in the card's own memory ---
set "VICTORY_CARD_BUFFERS_MIN_KB=64"

"E:\Games\XSX\emu\belobug\target\diag\victory.exe" run "E:\Games\XSX\Game\GTA6.Xbox.v1.0.2\game_scarlett_master.exe" --console series-s --execute
exit /b %ERRORLEVEL%

this my setting glitcches on screen and tree not show up but work between 15-25 fps

**@⁠nerdjb** on GitHub · 2026-11-26 20:51 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/338#issuecomment-7203147838) it work bro @⁠echo off setlocal rem --------------------------------------------------------------------------- rem Best-known settings for the Series S profile on an RX 9070 XT. rem run-GTA6-safe.cmd the fork's default profile, no experiments rem test-setup.cmd checks this install without starting the title rem --------------------------------------------------------------------------- set "VICTORY_CONFIG=E:\Games\XSX\emu\belobug\victory.toml" set "TEMP=E:\Games\XSX\temp" set "TMP=E:\Games\XSX\temp" if not exist "%TEMP%" mkdir "%TEMP%" rem --- the fork's default profile (scripts\play.ps1, no -Safe) --- set "VICTORY_TEXTURE_NO_WAIT=1" set "VICTORY_RELAY=2" set "VICTORY_WIDE_BACK=1" set "VICTORY_CARD_REHASH_RUNS=1" set "VICTORY_JOIN_COPIES=1" set "VICTORY_INDIRECT_WINDOW=1" set "VICTORY_RELAY_COPY=1" set "VICTORY_CARD_STEPS=2" set "VICTORY_INDIRECT_BATCH=2" set "VICTORY_MAP_THREADS=1" set "VICTORY_TITLE_PRIORITIES=0" set "VICTORY_CARD_AWAKE=1" set "VICTORY_SHOW_AFTER=1" set "VICTORY_AMBIENT=0.8" set "VICTORY_D3D12_DRED=light" set "VICTORY_UNDER_WIDE=0" set "VICTORY_LAND_ECHO=0" set "VICTORY_THIN=1" set "VICTORY_JOIN_PARTS=8" set "VICTORY_UPLOAD_AHEAD=1" rem --- Series S profile: 1080p output --- set "VICTORY_OUTPUT=1920x1080" rem --- renderer ports 1, 2, 4, 5 and 7 of docs/findings.md --- set "VICTORY_PORT_CONSTANTS=1" set "VICTORY_PORT_DESCRIPTORS=1" set "VICTORY_PORT_CBV=1" set "VICTORY_PORT_GUARD=1" set "VICTORY_PORT_JOURNAL=1" rem --- record the pipelines this run creates, so precache.cmd warm can rem build them ahead of the next one --- set "VICTORY_PIPELINE_BOOK=1" rem --- small title buffers' copies in the card's own memory --- set "VICTORY_CARD_BUFFERS_MIN_KB=64" "E:\Games\XSX\emu\belobug\target\diag\victory.exe" run "E:\Games\XSX\Game\GTA6.Xbox.v1.0.2\game_scarlett_master.exe" --console series-s --execute exit /b %ERRORLEVEL% this my setting glitcches on screen and tree not show up but work between 15-25 fps
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 20:55 UTC · original

@⁠nerdjb thanks for the settings, that's a useful data point: an RX 9070 XT with all five renderer ports on, Series S at 1080p.

The ports (VICTORY_PORT_CONSTANTS, _DESCRIPTORS, _CBV, _GUARD, _JOURNAL) are off by default on this line while they are being tested. This issue is about port 2, VICTORY_PORT_DESCRIPTORS=1: with it, some descriptor records the title writes are not reported by the patched stores and are only caught later by the fallback check. A view that is stale for a while could show as wrong or missing textures. That is not shown here, only possible.

If you have time, two launches with the same script and the same save would tell whether your glitches and missing trees come from the ports:

  1. The five VICTORY_PORT_* lines removed. Everything else stays as it is.
  2. If (1) looks right, add back only VICTORY_PORT_DESCRIPTORS=1.

For each launch: glitches yes/no, trees yes/no, and the fps. Your diag build also logs a port-2 summary line with view records missed. Its last value from the launch with the ports on would help here too.

**@⁠adrianmjim** on GitHub · 2026-11-26 20:55 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/338#issuecomment-7203204653) @⁠nerdjb thanks for the settings, that's a useful data point: an RX 9070 XT with all five renderer ports on, Series S at 1080p. The ports (`VICTORY_PORT_CONSTANTS`, `_DESCRIPTORS`, `_CBV`, `_GUARD`, `_JOURNAL`) are off by default on this line while they are being tested. This issue is about port 2, `VICTORY_PORT_DESCRIPTORS=1`: with it, some descriptor records the title writes are not reported by the patched stores and are only caught later by the fallback check. A view that is stale for a while could show as wrong or missing textures. That is not shown here, only possible. If you have time, two launches with the same script and the same save would tell whether your glitches and missing trees come from the ports: 1. The five `VICTORY_PORT_*` lines removed. Everything else stays as it is. 2. If (1) looks right, add back only `VICTORY_PORT_DESCRIPTORS=1`. For each launch: glitches yes/no, trees yes/no, and the fps. Your diag build also logs a port-2 summary line with `view records missed`. Its last value from the launch with the ports on would help here too.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 06:24 UTC · original

@⁠nerdjb, here is a ports-on vs ports-off comparison on my side (RDNA3), so you have something to compare with.

Setup: RX 7900 XT (RDNA3), driver 32.0.32029.2010, Windows 11 26300, 32 GB RAM. a-publier cd8dfc0 diag build, --console series-s, scripts/play.ps1 defaults. My settings match your script, except that I did not set VICTORY_OUTPUT=1920x1080, VICTORY_CARD_BUFFERS_MIN_KB=64, VICTORY_PIPELINE_BOOK=1, VICTORY_UNDER_WIDE=0 or VICTORY_LAND_ECHO=0. The pipeline cache was warm and was built with the ports on (83,558 pipelines).

I ran two passes back to back with the same data dir:

  • A: all five VICTORY_PORT_*=1.
  • P: those five lines removed. The log has no renderer port lines, which confirms they were off.

Each pass went from the title screen into the opening in-engine cutscene, ran ~4 min with no input, and then I closed the window. The window runs from the first frame of 500 draws or more to window closed. One half-size capture was saved every 8 frames.

A (ports on) P (ports off)
Window 253.6 s 274.8 s
fps median / p10 / p90 14.0 / 3.06 / 19.68 11.4 / 3.1 / 17.8
fps, time-weighted 12.0 10.5
fps median, +105 to +240 s 15.4 13.9
draws/frame, median 3033 3055
host pipelines made in window 134 833
title copies/frame, median 866 (2.1 MB) 7,584 (5.2 MB)
copies, median 17.0 ms, 84.7 MB/frame 24.3 ms, 108.7 MB/frame
bus up, median 32.5 MB/frame 45.5 MB/frame
guard faults, median 170 360
title textures with no host copy at close 11,923 39,974
ERROR / panic / device removed 0 / 0 / 0 0 / 0 / 0

The ports-off pass started with a cold cache. VICTORY_PORT_CBV is part of the shader cache key (shader_cache.rs build() adds it only when the port is on), so a cache warmed with the ports on does not cover a ports-off run. P entered the cutscene with ~1000 pipelines being made and only reached 0 at ~+105 s. Most of its lower fps is in that stretch: median 3.6 fps over 0-105 s.

After that, ports on is ~10% faster here (15.4 vs 13.9 fps), which fits the extra copy traffic with the ports off. P also logged one WARN that no ports-on pass has: HERO LEAD: a placed texture view lies in the memory of a texture the host copied into ... (22:52:51 UTC, view 0x58dc80000, 256x256, fmt 98).

Port 2 counts: these runs are on cd8dfc0, before #354. In A, view records missed grew by ~132/frame over the cutscene, and the fallback took a median of 5.0 ms/frame (p90 16.4). #354 stops counting taken marks that the fallback pages overlap, so part of that may have been the counting itself. I'll redo the count on a build with #354 before reading anything into it.

What I saw. I aligned the captures by wall clock; the cutscene is time-driven.

  • From ~+104 s to the end of A, I found no rendering difference between ports on and off. Geometry, lighting and text match, and the outdoor shots have the same trees and palms in both. Nothing is missing. A horizontal streak line in one interior shot appears in both passes, so it is not port-related.
  • In the first ~65 s, P differs from A, but only while its pipelines were still being made:
    • Every in-engine shot captured in the first ~37 s is near-black (mean ~0.38/255). The final post-process pattern is still there over an empty scene.
    • The logo on one 2D card never appears.
    • At 40-45 s the characters' hair is badly corrupted across 4 consecutive captures (1676-1692). It is clean again by 1700 (47.7 s).
  • A and the second ports-on pass are clean at those same moments. I put this down to the cold cache: P dropped 81-922 draws/frame while their pipelines were being made. With only one ports-off run, I can't separate that from the ports themselves.

So on this RX 7900 XT with a warm cache, the ports on show no glitches or missing trees in this cutscene, and turning them off shows nothing they were breaking. That does not rule out what you see on RDNA4, or in gameplay.

For your ports-off launch: the first launch without the ports builds a different pipeline set, so the first minute or two may show black or broken frames for that reason alone. Judge glitches and trees only once the (N being made) count in the fps log line reaches 0, or use a second launch without the ports.
Not tested:

  • Only the opening cutscene. No gameplay.
  • ~4 min per pass, one run per setting.
  • Ports off with a cache warmed for ports off.
  • Port 2 on its own.
  • 1080p output.
**@⁠adrianmjim** on GitHub · 2026-11-27 06:24 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/338#issuecomment-7211492320) @⁠nerdjb, here is a ports-on vs ports-off comparison on my side (RDNA3), so you have something to compare with. Setup: RX 7900 XT (RDNA3), driver 32.0.32029.2010, Windows 11 26300, 32 GB RAM. a-publier cd8dfc0 diag build, `--console series-s`, `scripts/play.ps1` defaults. My settings match your script, except that I did not set `VICTORY_OUTPUT=1920x1080`, `VICTORY_CARD_BUFFERS_MIN_KB=64`, `VICTORY_PIPELINE_BOOK=1`, `VICTORY_UNDER_WIDE=0` or `VICTORY_LAND_ECHO=0`. The pipeline cache was warm and was built with the ports on (83,558 pipelines). I ran two passes back to back with the same data dir: - A: all five `VICTORY_PORT_*=1`. - P: those five lines removed. The log has no `renderer port` lines, which confirms they were off. Each pass went from the title screen into the opening in-engine cutscene, ran ~4 min with no input, and then I closed the window. The window runs from `the first frame of 500 draws or more` to `window closed`. One half-size capture was saved every 8 frames. | | A (ports on) | P (ports off) | |---|---|---| | Window | 253.6 s | 274.8 s | | fps median / p10 / p90 | 14.0 / 3.06 / 19.68 | 11.4 / 3.1 / 17.8 | | fps, time-weighted | 12.0 | 10.5 | | fps median, +105 to +240 s | 15.4 | 13.9 | | draws/frame, median | 3033 | 3055 | | host pipelines made in window | 134 | 833 | | title copies/frame, median | 866 (2.1 MB) | 7,584 (5.2 MB) | | copies, median | 17.0 ms, 84.7 MB/frame | 24.3 ms, 108.7 MB/frame | | bus up, median | 32.5 MB/frame | 45.5 MB/frame | | guard faults, median | 170 | 360 | | title textures with no host copy at close | 11,923 | 39,974 | | ERROR / panic / device removed | 0 / 0 / 0 | 0 / 0 / 0 | The ports-off pass started with a cold cache. `VICTORY_PORT_CBV` is part of the shader cache key (`shader_cache.rs` `build()` adds it only when the port is on), so a cache warmed with the ports on does not cover a ports-off run. P entered the cutscene with ~1000 pipelines being made and only reached 0 at ~+105 s. Most of its lower fps is in that stretch: median 3.6 fps over 0-105 s. After that, ports on is ~10% faster here (15.4 vs 13.9 fps), which fits the extra copy traffic with the ports off. P also logged one WARN that no ports-on pass has: `HERO LEAD: a placed texture view lies in the memory of a texture the host copied into ...` (22:52:51 UTC, view 0x58dc80000, 256x256, fmt 98). Port 2 counts: these runs are on cd8dfc0, before #354. In A, `view records missed` grew by ~132/frame over the cutscene, and the fallback took a median of 5.0 ms/frame (p90 16.4). #354 stops counting taken marks that the fallback pages overlap, so part of that may have been the counting itself. I'll redo the count on a build with #354 before reading anything into it. What I saw. I aligned the captures by wall clock; the cutscene is time-driven. - From ~+104 s to the end of A, I found no rendering difference between ports on and off. Geometry, lighting and text match, and the outdoor shots have the same trees and palms in both. Nothing is missing. A horizontal streak line in one interior shot appears in both passes, so it is not port-related. - In the first ~65 s, P differs from A, but only while its pipelines were still being made: - Every in-engine shot captured in the first ~37 s is near-black (mean ~0.38/255). The final post-process pattern is still there over an empty scene. - The logo on one 2D card never appears. - At 40-45 s the characters' hair is badly corrupted across 4 consecutive captures (1676-1692). It is clean again by 1700 (47.7 s). - A and the second ports-on pass are clean at those same moments. I put this down to the cold cache: P dropped 81-922 draws/frame while their pipelines were being made. With only one ports-off run, I can't separate that from the ports themselves. So on this RX 7900 XT with a warm cache, the ports on show no glitches or missing trees in this cutscene, and turning them off shows nothing they were breaking. That does not rule out what you see on RDNA4, or in gameplay. For your ports-off launch: the first launch without the ports builds a different pipeline set, so the first minute or two may show black or broken frames for that reason alone. Judge glitches and trees only once the `(N being made)` count in the `fps` log line reaches 0, or use a second launch without the ports. Not tested: - Only the opening cutscene. No gameplay. - ~4 min per pass, one run per setting. - Ports off with a cache warmed for ports off. - Port 2 on its own. - 1080p output.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 07:01 UTC · original

Follow-up to my port-2 numbers above: I re-ran pass A's setup on a build with #354.

Setup: same machine, data dir and settings as pass A above (all five VICTORY_PORT_*=1). The build is cd8dfc0 plus only #354's commit (4ad8527). The PR only touches descriptor.rs and port_descriptors.rs, so the translator and shader-cache code are unchanged. Route: title screen, then the opening cutscene for ~4 min with no input, then I closed the window. One logged run.

The two runs did not start from the same state:

  • A ran the evening before.
  • A sat ~52 min on the title screen first: its window starts at frame 93,313, against 2,090 for the #354 run.
  • A was still making pipelines when the window started (90 queued) and at times later. The #354 run, which came after the other passes and after a #354 launch I stopped at the title screen, had them all made (0 queued, apart from a single 1).

Over the window from the first frame of 500 draws or more to window closed, from the port 2 per frame lines (percentiles are nearest-rank):

A (cd8dfc0) cd8dfc0 + #354
Window / frames 253.6 s / ~3,040 254.8 s / ~3,610
view records no store told of per frame, median (p10 / p90) 137.7 (76.8 / 171.8) 138.3 (79.5 / 178.7)
growth of view records missed per frame 131.9 138.0
fallback time, median / p90 / max 5.01 / 16.47 / 429.7 ms 0.69 / 0.88 / 22.5 ms
fallback time, median, +227 s to end (no pipelines queued in either run) 3.3 ms 0.69 ms
pages looked at whole, per frame 16.0 16.0
title memcpy/memmove calls into the heap per frame, median / records they marked (max) 2,986 / 0 2,984 / 0
no store told of WARN lines 5,990 14
ERROR / panic / device removed 0 / 0 / 0 0 / 0 / 0

What I read from it:

  • The missed count is not the overlap artifact #354 removes. view records no store told of and view records missed are the same counters (CHECKED[1], MISSED_ALL) in both builds. #354 stops counting slots that were taken this frame inside a checked page. The count still stayed at ~135-140 per frame. So the fallback still finds ~140 view records per frame that no patched store, hooked memcpy/memmove or call of ours told of.
  • The fallback cost dropped from ~5 ms to ~0.7 ms per frame. That is summed thread time across the records pool, not frame time. Where neither run was making pipelines it is 3.3 ms against 0.69 ms. A's biggest spikes (163-430 ms) all fall at +159 to +163 s, during a pipeline stall the #354 run did not have. #354 makes the parts disjoint, and it also cuts the WARN lines written inside the timed loop. I did not separate the two.
  • The WARN drop (5,990 to 14 lines) is the throttle, not fewer misses. #354 keys the existing n < 20 || power of two throttle on the since-start count instead of the per-line one.
  • Two counters are not comparable across the builds, because #354 changed what they count:
    • of draws' tables: 53.6 to 16.7 median. Before #354 it also counted told-not-taken records, and it exceeded the missed count in 50 of A's 232 lines. Now it is a true subset.
    • told and not taken yet: 87.7 to 3.7. It no longer includes slots taken this frame inside a checked page.

The top six entries of the their writers list are the same in both builds, in about the same shares. The counts are since process start:

Entry Share
0x7ffc69f3c26f (not the title's) ~37%
title+0x18849c ~25%
0x7ffaf4d20000 (not the title's) ~10%
title+0x4e9b4e2 ~6%
title+0x2474afc ~5%
0x7ffc69f3c1d3 (not the title's) ~5%

These entries are the last instruction that faulted on the record's 64 KiB block, not necessarily the instruction that wrote the record. 0x7ffaf4d20000 is 0x70000 below the title image base. It looks like the start of the stub area for the patched stores, which store and then mark. If so, this attribution cannot name the writer. I have not looked further at the entries outside the image.

Median fps was 16.6 against 15.4 from +105 to +240 s. A still had pipelines queued in that stretch (up to 27, stalls down to 1.7 fps), so I would not credit #354 with it.

Not tested: gameplay, ports off with this build, other GPUs, repeat runs.

**@⁠adrianmjim** on GitHub · 2026-11-27 07:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/338#issuecomment-7212070192) Follow-up to my port-2 numbers above: I re-ran pass A's setup on a build with #354. Setup: same machine, data dir and settings as pass A above (all five `VICTORY_PORT_*=1`). The build is cd8dfc0 plus only #354's commit (4ad8527). The PR only touches `descriptor.rs` and `port_descriptors.rs`, so the translator and shader-cache code are unchanged. Route: title screen, then the opening cutscene for ~4 min with no input, then I closed the window. One logged run. The two runs did not start from the same state: - A ran the evening before. - A sat ~52 min on the title screen first: its window starts at frame 93,313, against 2,090 for the #354 run. - A was still making pipelines when the window started (90 queued) and at times later. The #354 run, which came after the other passes and after a #354 launch I stopped at the title screen, had them all made (0 queued, apart from a single 1). Over the window from `the first frame of 500 draws or more` to `window closed`, from the port 2 `per frame` lines (percentiles are nearest-rank): | | A (cd8dfc0) | cd8dfc0 + #354 | |---|---|---| | Window / frames | 253.6 s / ~3,040 | 254.8 s / ~3,610 | | `view records no store told of` per frame, median (p10 / p90) | 137.7 (76.8 / 171.8) | 138.3 (79.5 / 178.7) | | growth of `view records missed` per frame | 131.9 | 138.0 | | fallback time, median / p90 / max | 5.01 / 16.47 / 429.7 ms | 0.69 / 0.88 / 22.5 ms | | fallback time, median, +227 s to end (no pipelines queued in either run) | 3.3 ms | 0.69 ms | | pages looked at whole, per frame | 16.0 | 16.0 | | title memcpy/memmove calls into the heap per frame, median / records they marked (max) | 2,986 / 0 | 2,984 / 0 | | `no store told of` WARN lines | 5,990 | 14 | | ERROR / panic / device removed | 0 / 0 / 0 | 0 / 0 / 0 | What I read from it: - **The missed count is not the overlap artifact #354 removes.** `view records no store told of` and `view records missed` are the same counters (`CHECKED[1]`, `MISSED_ALL`) in both builds. #354 stops counting slots that were taken this frame inside a checked page. The count still stayed at ~135-140 per frame. So the fallback still finds ~140 view records per frame that no patched store, hooked memcpy/memmove or call of ours told of. - **The fallback cost dropped from ~5 ms to ~0.7 ms per frame.** That is summed thread time across the records pool, not frame time. Where neither run was making pipelines it is 3.3 ms against 0.69 ms. A's biggest spikes (163-430 ms) all fall at +159 to +163 s, during a pipeline stall the #354 run did not have. #354 makes the parts disjoint, and it also cuts the WARN lines written inside the timed loop. I did not separate the two. - **The WARN drop (5,990 to 14 lines) is the throttle, not fewer misses.** #354 keys the existing `n < 20 || power of two` throttle on the since-start count instead of the per-line one. - **Two counters are not comparable across the builds**, because #354 changed what they count: - `of draws' tables`: 53.6 to 16.7 median. Before #354 it also counted told-not-taken records, and it exceeded the missed count in 50 of A's 232 lines. Now it is a true subset. - `told and not taken yet`: 87.7 to 3.7. It no longer includes slots taken this frame inside a checked page. The top six entries of the `their writers` list are the same in both builds, in about the same shares. The counts are since process start: | Entry | Share | |---|---| | `0x7ffc69f3c26f` (not the title's) | ~37% | | `title+0x18849c` | ~25% | | `0x7ffaf4d20000` (not the title's) | ~10% | | `title+0x4e9b4e2` | ~6% | | `title+0x2474afc` | ~5% | | `0x7ffc69f3c1d3` (not the title's) | ~5% | These entries are the last instruction that faulted on the record's 64 KiB block, not necessarily the instruction that wrote the record. `0x7ffaf4d20000` is 0x70000 below the title image base. It looks like the start of the stub area for the patched stores, which store and then mark. If so, this attribution cannot name the writer. I have not looked further at the entries outside the image. Median fps was 16.6 against 15.4 from +105 to +240 s. A still had pipelines queued in that stretch (up to 27, stalls down to 1.7 fps), so I would not credit #354 with it. Not tested: gameplay, ports off with this build, other GPUs, repeat runs.
This discussion has been locked. Commenting is limited to contributors.
No description provided.