Copy-back by memory class (#3838) cannot be made correct: the class is a caching statement, not a reader set (warm-launch face stretch, measurements) #4426
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#4426
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?
@Marsietiss on GitHub · 2026-11-30 20:16 UTC · original
Filed so nobody spends more time on this lead. Note: drafted with Claude from my own runs and code reading; the fork build is a hand port of #3838, card RTX 5080, Series S profile.
Summary
Skipping the copy-back of shader writes by declared memory class (#3838:
VICTORY_UNIFIED_BACKwithWC_PIECES,WC_NO_BACK_PC, the byte floor and the shared-range rule) cannot be made correct by tuning classes, floors or the alias size.play.rsalready leaves it off after #4028 #4055 #4012 #4024 #4038 #4058. This issue gives the reason from the console contract and four measurements, so the class masks do not get retried one by one.What the console contract says, and what it does not
All in my own words, from the GDK documentation (graphics memory overview; physical page mapping reference; GPU synchronization on Scarlett).
So the invariant a layer with separate host copies has to keep is: bytes a shader wrote reach every host copy of the same physical pages before the next reader of any of them. The class tells you which CPU reads are cheap. It says nothing about GPU readers through other copies, and those are what break.
Measured (fork port, RTX 5080)
UNIFIED_BACK=1(default classes,WC_PIECES=2,WC_NO_BACK_PC=1, floor 1024, shared-range rule on)unified_back0 and lists 32 switched liveThe warm row matters: an earlier reading here, and mine on #3838, was that the stretch needs draws dropped during pipeline builds. It does not.
The shared-range rule in
docs/unified-memory-classes.mdis the right idea (copy back when another copy holds the bytes) but it is decided when the piece lands, for copies under 1 MiB that exist at that moment. A copy made later over the same pages, a larger window, or a texture view of them, takes the bytes from title memory, which never got the write. That is the same fault the doc describes for the face skinning data, through a reader the rule did not see.What the copy-back actually costs (same card, same scene)
With copy-back of everything and 32 lists: 39.4 ms a frame, of which 17.0 ms is copying back 38.8 MB on the relay, 10.0 ms copies up (73.9 MB), 5.8 ms GPU. So the prize is real; the class filter is just not a safe way to take it.
Where I am putting the time instead: no copy at all
Heaps opened on title memory in place (
OpenExistingHeapFromAddress1on our own view of the section), a compute pass that compares the card side with a reference twin on the card and stores only changed dwords into title memory before the fence. Numbers that may save others a day, RTX 5080, driver 616.56, PCIe 5 x16, tests only, no game:Ask
docs/unified-memory-classes.md, with the warm-launch result.@github-actions[bot] on GitHub · 2026-11-30 20:16 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
@Marsietiss on GitHub · 2026-11-30 20:17 UTC · original
One open problem on the in-place route, stated plainly: it does not work yet, and it needs a trick I do not have a measured answer for.
The landing pass may only store dwords a shader changed (storing the unchanged ones in between would undo title CPU writes, which the race test guards). Real changed data is not dense, so many 64-byte lines get stores with gaps between them, and those cost about 330 ns a line on this card against 2.5 ns for a line with one run. About 5 ms per MB of such lines, in front of the fence. That can eat the whole 17 ms prize.
What I am measuring now, same harness:
If anyone knows why a gapped line is 130 times slower (my guess: the write to system memory can carry byte enables only on its first and last dword, so a gapped line is split and serialised), or knows a store pattern, a heap flag or a driver path that avoids it on NVIDIA or AMD, that is the missing piece. Numbers from other cards with the same three patterns (every dword, 1 dword in 16, every other dword) would also tell whether this is one vendor's behaviour.
@Marsietiss on GitHub · 2026-11-30 20:22 UTC · original
Pinging the people whose work this touches, in case it saves you time:
@gabrielecabrini on GitHub · 2026-11-30 20:31 UTC · original
I only have an RTX 4070 SUPER (Linux, Proton, PCIe 4.0), so it's still NVIDIA. It won't answer the vendor question, but it can show whether the gap cost is specific to Blackwell, PCIe 5 or the Windows driver. I don't see the test on main: can you push the branch or tell me the test name? I'll run the three patterns.
@Marsietiss on GitHub · 2026-11-30 20:33 UTC · original
@gabrielecabrini thanks, a 4070 SUPER on Linux answers exactly those three (Blackwell, PCIe 5, Windows driver). The test is on a fork branch that is not public yet; I am asking whether I can push it. Until then it is small enough to rebuild from this, on top of the in-place card tests from #4211:
OpenExistingHeapFromAddress1on a view of a section, as the layer does), a placed buffer over it as a raw UAV; a second 64 MiB buffer in card memory holding the data to store.d = group * 64 + thread;if (mask(d)) title.Store(d * 4, card.Load(d * 4));(d & 15) == 0(1 dword in 16, one run a line);(d & 1) == 0(every other dword, 8 gaps a line).ExecuteCommandListsto the fence, best of 5 after one warm-up, pages touched on the CPU first so no first-touch faults are in it. Report GB/s of stored bytes and ns per 64-byte line (1,048,576 lines per 64 MiB).Here: 43-45 GB/s (1.4 ns a line), 1.5-1.6 GB/s (2.5 ns a line), 0.1 GB/s (about 330 ns a line). A fourth mask worth having: two runs a line (
(d & 15) == 0 || (d & 15) == 8), which tells where the slow path starts; I am measuring that now.@Marsietiss on GitHub · 2026-11-30 20:36 UTC · original
@gabrielecabrini pushed: branch
rtx5080/zerocopy-gateon Marsietiss/Mangrove (one commit, a320781c6). No game needed, nothing else should be using the card:card_busprints GB/s and ns per 64-byte line for each pattern;card_raceis the lost-store check (takes a few minutes). It was only ever run on Windows; if opening the heap on a view fails under Proton, the HRESULT it prints is a result too.@Marsietiss on GitHub · 2026-11-30 20:42 UTC · original
Correction to my own table, from re-reading the warm run's log. I wrote that the warm launch had no pipelines being made and concluded the stretch does not need dropped draws. The first half holds (library loaded, 0 being made on every frame line). The second does not follow: that run still dropped draws without a host pipeline, about 250 a frame in the world and 2,400 to 2,950 a frame through the cutscene where the stretch showed.
What keeps the conclusion standing is the comparison: the two runs with 32 lists and copy-back of everything, which looked clean, drop the same amounts (median about 300 a frame, peaks 2,500 to 2,800). So dropped draws are present in both and do not separate stretched from clean; the class switch and the list count do. But "no drops on a warm launch" was wrong, and why draws are dropped with nothing being made is a separate question I am now reading.
@Marsietiss on GitHub · 2026-11-30 20:44 UTC · original
Result on the gapped-line problem (RTX 5080, test rig only, 64 MiB of title-side memory opened in place, GPU time by timestamps, median of 20):
So the slow path starts at the second run in a line, wherever the gap sits and whatever the run lengths. What fixes it is a dispatch boundary: dispatch j stores only the j-th run of every line, the k store dispatches are recorded back to back with no barrier between them, then one barrier and the dispatch that updates the reference copy. Cost is about 2.6 ns per (line, run). It raced clean against CPU threads storing into the neighbouring dwords (0 CPU stores undone, 0 owned dwords missing, one run of 2,000 landings, 8 runs a line only).
What did not help: reordering stores inside one dispatch (one thread per line in address order: 11-15x at 2 runs; one thread per 4 KiB page: 6-16x), 16 dispatches by column (3x even at 1 run), a copy command per run (36x at 2 runs, plus CPU time to record), and running the runs in turn inside one dispatch. Reading the title's line and writing it back whole is fast (6x, pattern-free) but undid 1.6 % of concurrent CPU stores, so it is not usable.
My reading, not proven: the cost comes from several writes reaching the same 64-byte line close together in time; only a dispatch boundary separates them enough. Whether the card or the root complex serialises them, the test cannot tell.
Not shown yet, and it matters: the rig has all 64 MiB behind one buffer and one indirect call; the real layout is many 2 MiB parts, each its own heap, with records written by a compaction pass. The per-dispatch overhead there is unmeasured, and so is the real mix of runs per line in a game frame (counting that next).
@gabrielecabrini on GitHub · 2026-11-30 20:47 UTC · original
Ran both on the RTX 4070 SUPER (Linux, Proton Experimental, vkd3d-proton, NVIDIA 620.73.04, PCIe 4.0). Both pass. Under Wine, FXC fails the store pass, and the fill's FXC blob gets its root signature refused (
0x80004005), so I compiled all passes with DXC (cs_6_0) locally.card_bus, 64 MiB, store into title memory:So the gap cost is there on Ada, PCIe 4 and the Linux driver too: about 80x a dense line here, about 235x on your 5080. Not Blackwell, PCIe 5 or the Windows driver. The two-runs-a-line mask isn't in this test, so I don't have that one.
card_race: 3 runs of 5,000 landings, ~21 billion CPU stores a run, 0 CPU stores undone, 0 pass dwords missing.@Marsietiss on GitHub · 2026-11-30 20:51 UTC · original
@gabrielecabrini thank you, that is exactly the answer: 194 ns a gapped line on Ada / PCIe 4 / Linux against 330 here, so it is not Blackwell, not PCIe 5 and not the Windows driver, and the race result holds on a second card and driver stack (21 billion CPU stores a run, 0 undone). Good to know about FXC under Wine and that
cs_6_0from DXC works.The two-runs mask and the split-dispatch variants from my last comment are now on the same branch (
rtx5080/zerocopy-gate, cce039ead, tests only):The row that matters most on your card: 2 runs and 8 runs a line, one pass against the split with no barrier between store dispatches (G2 in the output). If the split brings 8 runs down to about 8 times the one-run price there too, the trick is not specific to this card either.
@gabrielecabrini on GitHub · 2026-11-30 20:55 UTC · original
Ran both on the 4070 SUPER (same setup, DXC). 64 MiB, ns per line (x vs one run):
So the split works here too, about 8x at 8 runs. One difference: G1 (one dispatch, runs in turn with a device barrier and group sync) is as fast as the split on this card: 4.0 ns at 2 runs, 14.3 at 8. Without the barrier (G1b) it stays slow. G1 isn't in the race test.
Race, 2,000 landings each: B1, G2, C1, C2 and D all clean (0 undone, 0 missing). F (load + whole-line store) undid 0.73 % of CPU stores.
@Marsietiss on GitHub · 2026-11-30 20:55 UTC · original
@gabrielecabrini that settles it for NVIDIA: the split brings 8 runs to 8.5x there and 7.6x here, and it raced clean on both. Thank you.
The G1 difference is interesting: here the runs-in-turn dispatch with a barrier stays slow (30 ns at 2 runs, 120 at 8), on your card it matches the split. So a barrier inside one dispatch separates the writes enough on Ada / vkd3d-proton and not on this card and driver. I will keep the dispatch boundary as the rule, since it is the one that works on both.
Next from my side: the same test with the real layout (many 2 MiB parts, each its own heap, records written on the card) and the run mix counted in a game frame. I will post both here.
@Marsietiss on GitHub · 2026-11-30 21:01 UTC · original
The run mix from a game frame, as promised. Count only: the layer still copies everything back as before; a compute pass compares the card side with a reference copy on the card and counts what an in-place landing would store. RTX 5080, 256 lists in flight, copy-back of everything, in play after the first cutscene, per frame.
So the gapped-line problem touches under 2 % of lines. At the measured rates (2.6 ns per line and run with split dispatches) the stores for all of it come to under 1 ms a frame. That is an estimate from two measurements, not a measured frame.
Three checks that could have stopped this, and did not:
What it does not cover: only about 47 % of the flagged pieces are in scope. The rest is title memory that is not opened as a view of a section (private allocations), plus classes and lazily landed copies left out for now. All in-scope memory here is write-combined, and every in-scope block sits on a page that is mapped at more than one title address, so ownership has to be tracked per physical page, not per address. Nothing has stored into title memory in a game run yet; that is the next step.
@Marsietiss on GitHub · 2026-11-30 21:03 UTC · original
What I expect from this, what to be careful about, and where a second pair of hands would help. This is too big for one fork, and several of you are already close to it.
Expected gain (estimate, not measured)
Things that will bite (each one cost me a design round)
cs_6_0works (thanks @gabrielecabrini).Where parallel work would help most
rtx5080/zerocopy-gate(bus patterns, split dispatches, race). All results so far are NVIDIA.I will keep posting numbers here as each step is measured, including the ones that go wrong.
@banaanpapa on GitHub · 2026-11-30 21:03 UTC · original
@Marsietiss thanks for the ping and the numbers. Short answers, from what #3641 and #4174 do and from what I measured in play on an RTX 5080 today.
Granularity. Nothing finer than 64 KiB is built. A copy's bits are allocated per copy (
view_marks::Bits), a view's entry is (base bit, phase), and a store sets bitbase + ((phase + offset) >> 16). The shift is the only place the 64 KiB is fixed, plusVIEW_WRITE_BITS(2^22). Because bits are per copy and not per address, per line (>> 6) would be affordable: today's 3.4 GB of card copies need about 53 M bits, 6.6 MB in VRAM. The atomics stay one per marked store, with fewer collisions on a word if anything.What marks can and can't give an in-place landing:
WaveActiveBitOrover 32 consecutive dwords, then one atomic). Sub-dword stores, your 15 % of 1 to 3 byte changes, would still need byte masks or a compare for those dwords.memory.rs) and our own copies don't. #4174 falls back to the full compare for any copy that has an unmarked writer in the submission, and an in-place landing driven by marks would need the same fallback.Where the cost sits on this card. In play today (
e1251c31, about 4,800 draws a frame), our compare lists took 0.2 to 0.3 ms of card time a frame, so finding what changed is already cheap here. The copy-back on the CPU isn't: the relay's landing took 6 to 13 ms a frame in the user's runs (newest build and an older one). That agrees with your 17 to 27 ms. The prize is in landing the bytes, not in finding them, which is where your in-place route aims.If a shift switch for the marks helps your count (say
VICTORY_VIEW_MARK_SHIFT=12for 4 KiB pieces), I can add it to #4174.@Marsietiss on GitHub · 2026-11-30 21:06 UTC · original
@banaanpapa thanks, that is the clearest statement of what marks can and cannot do, and I agree with all three points. Your landing figure (6 to 13 ms on the relay) next to a 0.2 to 0.3 ms compare says the same thing from the other side.
Yes to the shift switch, and here is what I would use it for:
VICTORY_VIEW_MARK_SHIFT=12(4 KiB). A third of my flagged 64 KiB pieces turn out equal to the reference copy (285 of 770 a frame): flagged at 64 KiB, nothing changed in the part I look at. At 4 KiB I expect most of those to drop out, and the compare to read a fraction of the 50 MB it reads now. It also matches the unit the write journal has for title CPU writes, which makes "did the title write this page since the flight was prepared" a like-for-like test.>> 6) I would use as a filter in the store pass, not as a write set: skip lines with no mark before loading card and reference. At 6.6 MB of VRAM that is cheap. It does not remove the reference copy.One number that may help you size it: in scope here are about 5,500 blocks of 64 KiB a frame (350 MB of title memory behind 108 copies), all write-combined. Per-dword bits for that are about 11 MB.
If you add the shift, I will run the count with 16, 12 and 6 and post flagged pieces, equal-to-reference share and compare time for each.
@gabrielecabrini on GitHub · 2026-11-30 21:07 UTC · original
On private title memory, from what I measured on #4211 (4070 SUPER, Proton, vkd3d-proton):
OpenExistingHeapFromAddress1takes private, write-watched memory. It costs about 0.15–0.19 ms a MiB to open (like Windows) and the pages enter the working set.VirtualProtectandVirtualFreeinside an open part succeed here (on Windows they fail with error 87), so nothing stops the title freeing or guarding memory a pass is still writing. I haven't tested what the card does then.@Marsietiss on GitHub · 2026-11-30 21:09 UTC · original
@gabrielecabrini that is the missing half, thank you. How I read it against my counts:
The ownership table that this hook drives is on
rtx5080/zerocopy-gatenow (lease.rs, tests only, with a randomised model test), next to a slot table for the parts (slots.rs, with a 2,800-part card probe). If you want to try to break the model, the unmap and free cases are where I trust it least.@gabrielecabrini on GitHub · 2026-11-30 21:19 UTC · original
Ran the free-under-a-running-pass test on the 4070 SUPER (Proton, vkd3d-proton). It's a local test, not on your branch. Same layout as the #4211 probe: private write-watched memory, a part opened with
OpenExistingHeapFromAddress1, a 256 KiB buffer in it. A store pass runs for about 500 ms, and 30 ms in (pass confirmed running, fence not reached) the title's call hits one 64 KiB page of the buffer. One case a process:VirtualProtectread-onlyMEM_DECOMMITof the pageMEM_RELEASE+ new allocation at the same addressNo device removal and no NVRM/Xid lines in the kernel log in any case. So on Proton it's the silent failure: no fault and no stores into recycled pages, the pass's stores just vanish (my guess: the driver keeps the old pages pinned). Your hook (settle the flights, close the part, then let the call through) is the only protection here.
@Marsietiss on GitHub · 2026-11-30 21:21 UTC · original
@gabrielecabrini that is a clean result and the worse of the two outcomes to design for: no fault, no stray stores, the landing just disappears. So on Proton a missed settle shows up as stale title memory minutes later with nothing in any log, exactly the kind of fault the class filter produced. Two things I take from it:
The read-only case is useful too: protection does not stop the card, so the write watch says nothing about card-owned blocks on either platform.
@gabrielecabrini on GitHub · 2026-11-30 21:23 UTC · original
More from the 4070 SUPER on Proton, on
8cdbeece:random_interleavings_match_the_referencepasses, all 8 seeds. Two harness notes:a_plan_let_go_without_close_is_caughtfails under--release(it relies on adebug_assert), andthe_probe_pass_compiles_with_the_tables_sizefails because FXC under Wine can't compile the probe.@gabrielecabrini on GitHub · 2026-11-30 21:25 UTC · original
One more, and it goes with your first point: settling isn't enough on Proton, the part has to be closed.
Private memory, part open as in the #4211 probe, no pass running. The title decommits a 64 KiB page of the buffer and commits it again (both succeed; the CPU reads zero). After that the card and the CPU see different pages: the card reads the old contents, not what the CPU wrote, and what the card stores never reaches the CPU. Only closing and reopening the part makes them see the same page again. No error anywhere.
The reserved page in my last comment was a section page committed after the part opened, and that one stayed coherent. A private page decommitted and committed again under an open part does not.
@Marsietiss on GitHub · 2026-11-30 21:25 UTC · original
@gabrielecabrini both go straight into the rules, thank you.
If you have time for one more: the same decommit-and-commit case on a section view page instead of private memory. If that one stays coherent, the split is a property of private pages only, and section views (all of my in-scope memory today) are safe from it even without the close.
@banaanpapa on GitHub · 2026-11-30 21:29 UTC · original
@Marsietiss before you plan around per-dword marks, I measured the marks in play, and the cost side changes my answer.
One session in the world, RTX 5080,
e1251c31with #3641 and #4174,VICTORY_VIEW_MARKS=1(64 KiB marks), 9 minutes, same scene as my runs without marks (about 4,800 draws a frame, the card 99 % busy):The extra card time holds through the run: 31-32 ms in each quarter, with no pipelines being made. Every marked store pays for a load of its view's entry, a wave election and a read of the bitmap word, and on a card-bound PC that's about 27 % more card time. All of it to save a compare that costs 0.2 ms here. Per-dword marks would add bitmap traffic on top of that, not take it away.
Coverage, for the record: per frame, 300 compared copies (692 pieces of 64 KiB) were left to their marks, 18 (18 pieces) were compared whole because a writer didn't mark, and none were without bits. So the marks see nearly everything here, but they're too expensive to keep on.
So I'd drop marks as the write-set source. Your compare against a reference copy on the card, a 0.49 ms count pass, is the better design on this card. I won't send the shift switch; at this cost it would only answer a question we no longer need answered.
On why gapped lines are slow (your open question), the specs back your guess, at two levels:
That fits your table: the slow path starts at the second run in a line, wherever the gap is. Your split into one dispatch per run gives each run its own contiguous write. It also says that wherever a pass can safely write whole lines, those are the cheapest of all.
@Marsietiss on GitHub · 2026-11-30 21:29 UTC · original
@banaanpapa measured beats planned: 27 % more card time to save a 0.2 to 0.5 ms compare is a clear no. I drop per-dword marks from my plan and stay with the compare against a reference copy; the cost of that is VRAM (about 470 MB here), which I will try to cut by keeping reference copies only for blocks the card actually owns instead of for every candidate copy. Thanks for running it rather than leaving it as an idea, and for the coverage numbers (18 of 318 copies with an unmarked writer).
The link-level reading matches everything measured on both cards: gaps in byte enables only inside one dword, so a second run in a line is a second write, and the partial line costs a read-merge-write at the host. It also explains why a whole line (1.4 ns) is cheaper than a one-run line (2.5 ns) here. I cannot write whole lines in general, because the title's CPU may be writing the other dwords, but there is one case where it is safe and common: lines where every dword changed. They already go out dense today; I will make sure the pass never splits them.
@gabrielecabrini on GitHub · 2026-11-30 21:30 UTC · original
The section view case, as asked: the decommit is refused with error 87 while the part is open (the commit after it is a no-op). Card, view A and a second view B all keep seeing one page both ways. So on Proton too the split is a property of private pages; section views are safe from it.
One more on private memory that matters for "the other half": on Proton a part over private memory opens with S_OK even when one of its pages is read-only,
PAGE_GUARD, or reserved, but then the whole part is detached from title memory. The card reads zero on every page, including plain ones, and CPU and card never see each other's writes, even after the page is made plain or committed. No error at open or later. Controls with every page plain (committed page by page, or at once) are coherent.So on Proton a successful open of private memory doesn't prove the heap is on it. The part has to be fully committed and plain at open, or checked with a read-back after opening. My guess is that vkd3d-proton's host-memory import fails and it quietly falls back to its own memory, but I haven't checked that. Sections don't do this: a 2 MiB part over a reserved section page stays coherent.
@gabrielecabrini on GitHub · 2026-11-30 21:33 UTC · original
Checked the detached private part with vkd3d-proton's log on. When one page is read-only or reserved, vkd3d-proton logs
vkd3d_import_host_memory: Failed to import host memory, hr 0x8007000eandOpenExistingHeapFromAddress1still returns S_OK, so it falls back to memory of its own. With every page plain there's no such line and the part is coherent. On Proton the only sign is that warning (off by default), so the layer needs its own check after opening a private part, e.g. a sentinel the CPU writes and the card reads back.@Marsietiss on GitHub · 2026-11-30 21:34 UTC · original
@gabrielecabrini that closes the section side and opens a clear rule for the private side:
That sentinel check is cheap enough to do on Windows as well, so I will make it unconditional rather than per platform. It also gives a number for the log: parts opened, parts that failed the read-back.
@gabrielecabrini on GitHub · 2026-11-30 21:35 UTC · original
One addition to the section side: it's safe because you open on your own view. I checked the write guard's case on Proton (it leaves 64 KiB blocks of the title's views read-only, on by default):
So the same silent fallback hits section parts if the opened view isn't plain. Worth having the sentinel check on section parts too, not only private ones. On the private side the layer only uses the write watch;
VICTORY_LAZY_LANDand the reader probes protect pages, but both are off by default.@Marsietiss on GitHub · 2026-11-30 21:38 UTC · original
@gabrielecabrini good catch, and it changes one line of my rule set: the sentinel round trip goes on every part at open, section or private, and the part is opened only on a view of our own that nothing ever protects (which is what the count build does today, but by habit, not by rule). A guard that leaves blocks read-only in the title's view is then harmless, as your second row shows. I will also add a start-up line saying how many parts failed the round trip, so a platform that falls back silently shows up in the first log.
@Marsietiss on GitHub · 2026-11-30 21:40 UTC · original
A housekeeping proposal: this has stopped being an issue. It is a running design thread with measurements from three people on two platforms, and it will keep growing while the store pass, the hooks and the private-memory half are built.
I suggest moving it to a Discussion (Ideas or a design category), where replies can be threaded per topic: one thread each for the card tests, the open-in-place rules per platform, the ownership and hook rules, and results from game runs. A maintainer can convert this issue in place ("Convert to discussion" in the sidebar), which keeps every comment and link. If that is not wanted, I can open a discussion myself, link it here and post a summary of the rules agreed so far as its first comment.
@gabrielecabrini @banaanpapa any preference? Until it moves I keep answering here.
@gabrielecabrini on GitHub · 2026-11-30 21:42 UTC · original
we can go to design and post a summary with the measurements
@Marsietiss on GitHub · 2026-11-30 21:44 UTC · original
@gabrielecabrini done: the design thread is now discussion #4516, with a summary of the measurements from both cards and the rules agreed so far as its first post. Corrections to that summary are welcome there. I will keep this issue for the original report only and answer design points in the discussion from now on.
@d0dev on GitHub · 2026-11-30 22:16 UTC · original
Another data point for the in-place landing tests: RTX 4070 Ti SUPER (Ada), Windows 11, driver 616.92, PCIe 4.0 x16, so Ada on Windows next to the 5080 (Windows) and the 4070 SUPER (Proton). Branch
rtx5080/zerocopy-gateat8cdbeece3, debug test build, nothing else on the card.card_gap_bus_store_variants_into_title_memory, 64 MiB, ns per 64-byte line (x vs one run):The gapped-line cost is here too (266 ns, between the 4070 SUPER's 194 and the 5080's 330). Two runs a line cost less than on either of your cards (about 5x against 9-17x). The dispatch boundary brings 8 runs to about 8x, same as on both.
card_race_plain_stores_into_title_memory_undo_no_cpu_store: 3 runs of 5,000 landings, about 1.9 billion CPU stores each: 0 undone, 0 shader dwords missing, counts as expected.card_gap_race_of_the_variants, 2,000 landings each: B1, G2, C1, C2 and D all 0 undone and 0 missing. F (load + whole-line store) undid 1.93 M beside and 2.05 M partial-dword bytes, about 10,300 per million CPU stores, so the test catches it.card_bus_speed_of_the_store_pass_card_and_title_memoryat 64 KiB: about 0.075 ms submit to fence in every case. Only the race layout stood out storing into title memory: 0.229 ms (0.161 ms GPU) against 0.074 into card memory.Full output available if useful.
@Marsietiss on GitHub · 2026-11-30 22:16 UTC · original
@d0dev thank you, a fourth card and the first Ada one on Windows. It agrees with the others where it matters: plain stores undo nothing (0 over 5.7 billion), the whole-line variant is caught, and one store dispatch per run brings 8 runs from 80x to about 8x with or without the barrier. The lower cost at two runs (5x) is new and fits the idea that the penalty is not the bus alone.
Two things that may interest you: the design moved to discussion #4516 (summary of all cards there, I will add yours), and a tester on an RTX 4090 reports that the gap cost follows the CPU cache attribute of the destination pages (write-combined destinations about 20 ns for 8 runs in one pass). That is being reproduced on the 5080 now; if it holds, the same test with a write-combined destination on your card would be the next data point worth having.