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
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD#338
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@adrianmjim on GitHub · 2026-11-26 20:47 UTC · original
Low priority. This only affects the opt-in
VICTORY_PORT_DESCRIPTORS=1path, which exists only ona-publierandrx9070xt(both atcd8dfc0).main(4f62c2a) has noport_descriptors.rsordescriptor_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 thescripts/play.ps1defaults plusVICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1andVICTORY_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)
6 of 6 descriptor record stores of the title patched. The heap isstart=0xd780000 count=1245184 stores=6. At 32 B per slot that is 38 MiB, or 608 pages of 64 KiB.71308 view records missed, against27349921 slots told(about 0.26%).of them of draws' tablesfield). The draw makes those anyway. See the counting caveat in point 6.4cb90befor this same gap (its comment says "~250 view records a frame"). It shows0 records they markedin 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.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).
take()first clears the marks (descriptor.rs:431). Then the fallback pages are added as more parts (descriptor.rs:444-446).victory-recordspool (land.rs:347-354, 6 threads by default).missed()seesmarked()as false, because the mark was already taken. A record that a patched store did report is then counted as missed.Copiedcontract 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 anunsafecontract.told and not taken yet.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.titlewrite::store(watch.rs:3810), or skipped bytry_read(line 218), never update it.0x7ffae9520000,+0x40,+0x80and+0xc0sit 0x70000 below the title image (mapped at0x7ffae9590000). From address arithmetic, these are most likely descriptor_sites stubs 0-3 (inferred):console_insn::nearprobes in 1 MiB steps below the first site, and this is the first spot below the image.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) andtitle+0x4d9f26e(17 WARNs) lie close to the patched graphics table filler at+0x4d9efd0.SITESwindows (descriptor_sites.rs:43-56).4. Fix-ups can come later than
EVERYframes, 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).COPIED_FRAMES=8). The draw makes the view it reads through a table at record time (draw.rs:3380-3399).COPIED_GRACE=4more frames.5. The WARN throttle resets with every summary.
n = CHECKED[1].fetch_add(line 314) is gated byn < 20 || n.is_power_of_two()(line 323), butline()swapsCHECKED[1]to 0 (line 434).6. The tabled count includes records that were told.
CHECKED[5]is incremented (lines 303-306) before themarked()early return (lines 309-313). Soof them of draws' tablescan 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) logged 13 times, withtimesgoing from 1 to 4096.address=0x0.buffer view not on an element of its host copyfired once from each site. In both cases the offset is not a multiple of the element size, so the view is made null:offset=9 element=32)offset=9 element=4)Not tested
VICTORY_PORT_DESCRIPTORS=1.Possible fixes (outline)
Copiedrequires.marked()check.line()never resets.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=64to see how much of the delay comes from the page budget.@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
@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:
VICTORY_PORT_*lines removed. Everything else stays as it is.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-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
cd8dfc0diag build,--console series-s,scripts/play.ps1defaults. My settings match your script, except that I did not setVICTORY_OUTPUT=1920x1080,VICTORY_CARD_BUFFERS_MIN_KB=64,VICTORY_PIPELINE_BOOK=1,VICTORY_UNDER_WIDE=0orVICTORY_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:
VICTORY_PORT_*=1.renderer portlines, 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 moretowindow closed. One half-size capture was saved every 8 frames.The ports-off pass started with a cold cache.
VICTORY_PORT_CBVis part of the shader cache key (shader_cache.rsbuild()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 missedgrew 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.
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 thefpslog line reaches 0, or use a second launch without the ports.Not tested:
@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 iscd8dfc0plus only #354's commit (4ad8527). The PR only touchesdescriptor.rsandport_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:
Over the window from
the first frame of 500 draws or moretowindow closed, from the port 2per framelines (percentiles are nearest-rank):cd8dfc0)cd8dfc0+ #354view records no store told ofper frame, median (p10 / p90)view records missedper frameno store told ofWARN linesWhat I read from it:
view records no store told ofandview records missedare 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.n < 20 || power of twothrottle on the since-start count instead of the per-line one.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 writerslist are the same in both builds, in about the same shares. The counts are since process start:0x7ffc69f3c26f(not the title's)title+0x18849c0x7ffaf4d20000(not the title's)title+0x4e9b4e2title+0x2474afc0x7ffc69f3c1d3(not the title's)These entries are the last instruction that faulted on the record's 64 KiB block, not necessarily the instruction that wrote the record.
0x7ffaf4d20000is 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.