[enhancement][memory] The title's own CPU readback buffers: a hook point for copy-back by intent (follow-up to #19) #287

Open
opened 2026-12-04 11:13:24 +00:00 by Yorivel · 5 comments

Follow-up to my proposal in #19 (#19 (comment)): first results on where the title asks for GPU results on the CPU. Addresses are RVAs in my dump's game_scarlett_master.exe (120,181,760 bytes). No game files are changed, and no decompiled code is posted here.

1. Textures: the title reads back one

DARNER_READ_WATCH=1, 15 minutes of mixed play: 826 textures the card writes were watched (493 by unordered access, 200 depth, 133 render targets). Title code touched exactly one: the 256x256 R8_UNORM render target that is already in DARNER_TEXTURE_BACK, from one place, +0x50313d2. No other watched texture was read by the title.

2. That read is a latency-tolerant readback

The function at 0x5031380 samples a 256x256 grid of bytes (signed around 0x80, scaled, x and y clamped), four times per query from 0x5031160. It reads through a small table of pointers, indexed by a value that 0x12bce40 reads and writes, which looks like a per-frame rotation. If so, the title reads a copy from an earlier frame, not the one the card is writing, and a copy-back of this target can land a frame or more late without the title seeing a difference.

3. The title has a readback buffer class: CpuReadBackShaderResourceBuffer

The function at 0x1adc2c0 (in a vtable, and called from 0x1d40f90) makes up to three buffers named CpuReadBackShaderResourceBuffer [0] to [2] through an allocation callback it is given, and keeps their addresses in the object. The count comes from a call on its second argument. That is the usual rotating readback: the card writes one copy while the CPU reads another.

Hooking it, found through its reference to that name so a title update doesn't lose it, would give Darner every readback buffer the title makes, as it makes it: copy those ranges back, leave the rest on the card. DARNER_LAND_LEAVE already does the second half from a file; this would make it a keep list filled by the title at run time.

4. Open

  • Whether the table in 2 is filled from this class or from another path.
  • How much of the copied-back memory these buffers are. A DARNER_LAND_READS=1 run is next, with a small patch (local for now, on main f3840d7) that logs the code place of each first touch by title code, through readwatch's module_of. I'll post the result here, and can open the patch as a PR.

Questions

  1. Any objection to hooking a title function that is found through a string reference?
  2. Would you want the keep list as its own switch (for example DARNER_LAND_KEEP_TITLE=1), off by default, beside DARNER_LAND_LEAVE?
Follow-up to my proposal in #19 (https://git.gtahub.st/TrustNo1/Darner/issues/19#issuecomment-863841): first results on where the title asks for GPU results on the CPU. Addresses are RVAs in my dump's `game_scarlett_master.exe` (120,181,760 bytes). No game files are changed, and no decompiled code is posted here. ### 1. Textures: the title reads back one `DARNER_READ_WATCH=1`, 15 minutes of mixed play: 826 textures the card writes were watched (493 by unordered access, 200 depth, 133 render targets). Title code touched exactly one: the 256x256 R8_UNORM render target that is already in `DARNER_TEXTURE_BACK`, from one place, `+0x50313d2`. No other watched texture was read by the title. ### 2. That read is a latency-tolerant readback The function at `0x5031380` samples a 256x256 grid of bytes (signed around 0x80, scaled, x and y clamped), four times per query from `0x5031160`. It reads through a small table of pointers, indexed by a value that `0x12bce40` reads and writes, which looks like a per-frame rotation. If so, the title reads a copy from an earlier frame, not the one the card is writing, and a copy-back of this target can land a frame or more late without the title seeing a difference. ### 3. The title has a readback buffer class: `CpuReadBackShaderResourceBuffer` The function at `0x1adc2c0` (in a vtable, and called from `0x1d40f90`) makes up to three buffers named `CpuReadBackShaderResourceBuffer [0]` to `[2]` through an allocation callback it is given, and keeps their addresses in the object. The count comes from a call on its second argument. That is the usual rotating readback: the card writes one copy while the CPU reads another. Hooking it, found through its reference to that name so a title update doesn't lose it, would give Darner every readback buffer the title makes, as it makes it: copy those ranges back, leave the rest on the card. `DARNER_LAND_LEAVE` already does the second half from a file; this would make it a keep list filled by the title at run time. ### 4. Open - Whether the table in 2 is filled from this class or from another path. - How much of the copied-back memory these buffers are. A `DARNER_LAND_READS=1` run is next, with a small patch (local for now, on main `f3840d7`) that logs the code place of each first touch by title code, through readwatch's `module_of`. I'll post the result here, and can open the patch as a PR. ### Questions 1. Any objection to hooking a title function that is found through a string reference? 2. Would you want the keep list as its own switch (for example `DARNER_LAND_KEEP_TITLE=1`), off by default, beside `DARNER_LAND_LEAVE`?
Author

Results of the DARNER_LAND_READS=1 runs promised above. Same PC and settings as in the issue (RTX 4090, i9-14900K, Series X, 1440p, DLSS Quality, frame generation 2x, hardware RT), main f3840d7 with #185, plus a small patch to land/reads.rs, described at the end.

Who touches a landed page first

Two runs, 15 min and 8 min (the second ended in a crash, see below). Pages the census watched, whole of the second run (the first agrees within a point):

First touch by Share
The title's code 1.1 %
The next landing (safecopy::merge reading title memory before it stores) 85.2 %
Nobody: landed in again untouched 13.7 %

So about 99 % of the watched pages are written by the card again before the title reads them. The "ours" touches are all darner_safe_copy_at (named from the PDB), that is, the next landing's own merge: not a read by anything else, and not a round trip.

The census of never-touched ranges is very stable between runs: the 16 biggest ranges hold 98 % of the never-touched pages, and 21 of their 22 MiB are the same in both runs.

Where the title reads

366 places in the first run. A touch inside vcruntime140's memcpy/memset is now put on its caller (the return address at the stack pointer, these being leaves), so the title's copies and ours are told apart. The busiest place, +0x55799cb, looks through entries tagged with the frame number minus two: a readback consumed two frames late. The readback class from section 3 is not among the places itself; its buffers seem to be read through shared helpers.

What a landing costs, and what's next

In normal play (no census), merging is about 1.2 ms a frame on the relay thread (3 ms on all landing threads); most of the copy-back time is the fetch of the pieces from the card. So leaving merges for later would save little: the gain is in not fetching. Next I'm A/B-testing DARNER_LAND_LEAVE with a list made from the ranges both censuses agree on (15 ranges, 21 MiB), against my earlier A runs, to measure what not fetching saves before building the keep list from the title's side.

A crash in the census itself

The second run ended with the title reading a page the census had made no-access, at +0x557b108, while the census no longer held that page, so the handler passed the fault on. Just before, shadow logged "a buffer's host copy is in the card's memory" for several 8-byte buffers on that same 4 KiB page. My guess is that moving a host copy into the card's memory changes or takes the page without telling the census. It's only reachable with DARNER_LAND_READS=1.

The patch

land/reads.rs: notes the code place of every first touch (module and offset, through readwatch::module_of), ours and other code's apart, puts touches inside the C runtime on their caller, and logs the most frequent places. I can open it as a PR if it's useful, with the crash above noted as known.

Results of the `DARNER_LAND_READS=1` runs promised above. Same PC and settings as in the issue (RTX 4090, i9-14900K, Series X, 1440p, DLSS Quality, frame generation 2x, hardware RT), main `f3840d7` with #185, plus a small patch to `land/reads.rs`, described at the end. ### Who touches a landed page first Two runs, 15 min and 8 min (the second ended in a crash, see below). Pages the census watched, whole of the second run (the first agrees within a point): | First touch by | Share | |---|---| | The title's code | 1.1 % | | The next landing (`safecopy::merge` reading title memory before it stores) | 85.2 % | | Nobody: landed in again untouched | 13.7 % | So about 99 % of the watched pages are written by the card again before the title reads them. The "ours" touches are all `darner_safe_copy_at` (named from the PDB), that is, the next landing's own merge: not a read by anything else, and not a round trip. The census of never-touched ranges is very stable between runs: the 16 biggest ranges hold 98 % of the never-touched pages, and 21 of their 22 MiB are the same in both runs. ### Where the title reads 366 places in the first run. A touch inside `vcruntime140`'s `memcpy`/`memset` is now put on its caller (the return address at the stack pointer, these being leaves), so the title's copies and ours are told apart. The busiest place, `+0x55799cb`, looks through entries tagged with the frame number minus two: a readback consumed two frames late. The readback class from section 3 is not among the places itself; its buffers seem to be read through shared helpers. ### What a landing costs, and what's next In normal play (no census), merging is about 1.2 ms a frame on the relay thread (3 ms on all landing threads); most of the copy-back time is the fetch of the pieces from the card. So leaving merges for later would save little: the gain is in not fetching. Next I'm A/B-testing `DARNER_LAND_LEAVE` with a list made from the ranges both censuses agree on (15 ranges, 21 MiB), against my earlier A runs, to measure what not fetching saves before building the keep list from the title's side. ### A crash in the census itself The second run ended with the title reading a page the census had made no-access, at `+0x557b108`, while the census no longer held that page, so the handler passed the fault on. Just before, `shadow` logged "a buffer's host copy is in the card's memory" for several 8-byte buffers on that same 4 KiB page. My guess is that moving a host copy into the card's memory changes or takes the page without telling the census. It's only reachable with `DARNER_LAND_READS=1`. ### The patch `land/reads.rs`: notes the code place of every first touch (module and offset, through `readwatch::module_of`), ours and other code's apart, puts touches inside the C runtime on their caller, and logs the most frequent places. I can open it as a PR if it's useful, with the crash above noted as known.
Author

Early preview, one run each, not a result yet. Leaving the never-read ranges on the card when shader writes are declared, instead of at the landing, halved what is copied back in my run. Heavy city scenes are not measured yet; that run is next.

Same PC and settings as above (RTX 4090, i9-14900K, Series X, 1440p, DLSS Quality, frame generation 2x, hardware RT, PGO build of main f3840d7 with #185). The list: 15 ranges, 21 MiB, the ranges both DARNER_LAND_READS censuses above found never touched by the title's code.

Two ways of leaving the same list

  • v0, at the landing: DARNER_LAND_LEAVE as it is on main: listed pieces are not fetched or merged. 185 pieces (5.6 MB) a frame were left, landed pieces fell by 42 %, but the relay's time did not fall. The card still hashes and compares those ranges before the landing decides.
  • v1, at the declaration: a small change to Shadow::shader_writes. The part of a declared shader write that lies in a listed range is left on the card the way DARNER_WC_NO_BACK leaves write-combined memory (self.leaves, no deferred write), so the card neither hashes nor compares it. The rest of the write goes on as before. About 70 MB a frame of declared writes were left this way.
10 min each, same save A (runs 1, 4) v0, at the landing v1, at the declaration
wc to copy back per frame, median 159 / 149 MB 147 MB 76 MB
relay "landing in all" per frame, median 11.9 / 15.0 ms 17.4 ms 8.2 ms
frames over 50 ms, whole run 2.8 / 5.5 % 10.2 % 0.9 %
frames over 50 ms, 3,000-5,000 draws 0.9 / 1.1 % 2.5 % 0.4 %
frames over 50 ms, 5,000-7,000 draws 3.7 / 3.6 % 6.0 % 2.1 %

No visual faults seen in either run with the list.

Caveats

  • The v1 run had lighter scenes than the A runs: no samples above 9,000 draws, and only five at 7,000-9,000. The whole-run figures gain from that; the per-band rows above are the fairer comparison.
  • It started stuttering at the very end, driving into the city: the texture queue went from about 2,600 to 10,300 slots, 2,939 of them waiting for memory, the oldest 42 frames behind (video memory itself 20.3 of a 21.3 GB line). That looks like texture streaming rather than landing, but it's exactly the scene still to measure.
  • The list comes from this PC's census. The addresses held between my runs; I don't know yet whether they're the same elsewhere.

Next

A run into the city early, with v1 plus #274 (its retirement queue walk blocks the relay too). If the heavy scenes hold up, I'll open v1 as its own PR: the switch, with how to make a list with DARNER_LAND_READS, not a ready-made list. The keep list filled from the title's readback buffers (section 3 of the issue) is still the aim; this shows what leaving memory on the card at the declaration is worth.

**Early preview, one run each, not a result yet.** Leaving the never-read ranges on the card *when shader writes are declared*, instead of at the landing, halved what is copied back in my run. Heavy city scenes are not measured yet; that run is next. Same PC and settings as above (RTX 4090, i9-14900K, Series X, 1440p, DLSS Quality, frame generation 2x, hardware RT, PGO build of main `f3840d7` with #185). The list: 15 ranges, 21 MiB, the ranges both `DARNER_LAND_READS` censuses above found never touched by the title's code. **Two ways of leaving the same list** - **v0, at the landing:** `DARNER_LAND_LEAVE` as it is on main: listed pieces are not fetched or merged. 185 pieces (5.6 MB) a frame were left, landed pieces fell by 42 %, but the relay's time did not fall. The card still hashes and compares those ranges before the landing decides. - **v1, at the declaration:** a small change to `Shadow::shader_writes`. The part of a declared shader write that lies in a listed range is left on the card the way `DARNER_WC_NO_BACK` leaves write-combined memory (`self.leaves`, no deferred write), so the card neither hashes nor compares it. The rest of the write goes on as before. About 70 MB a frame of declared writes were left this way. | 10 min each, same save | A (runs 1, 4) | v0, at the landing | v1, at the declaration | |---|---|---|---| | wc to copy back per frame, median | 159 / 149 MB | 147 MB | **76 MB** | | relay "landing in all" per frame, median | 11.9 / 15.0 ms | 17.4 ms | **8.2 ms** | | frames over 50 ms, whole run | 2.8 / 5.5 % | 10.2 % | **0.9 %** | | frames over 50 ms, 3,000-5,000 draws | 0.9 / 1.1 % | 2.5 % | 0.4 % | | frames over 50 ms, 5,000-7,000 draws | 3.7 / 3.6 % | 6.0 % | 2.1 % | No visual faults seen in either run with the list. **Caveats** - The v1 run had lighter scenes than the A runs: no samples above 9,000 draws, and only five at 7,000-9,000. The whole-run figures gain from that; the per-band rows above are the fairer comparison. - It started stuttering at the very end, driving into the city: the texture queue went from about 2,600 to 10,300 slots, 2,939 of them waiting for memory, the oldest 42 frames behind (video memory itself 20.3 of a 21.3 GB line). That looks like texture streaming rather than landing, but it's exactly the scene still to measure. - The list comes from this PC's census. The addresses held between my runs; I don't know yet whether they're the same elsewhere. **Next** A run into the city early, with v1 plus #274 (its retirement queue walk blocks the relay too). If the heavy scenes hold up, I'll open v1 as its own PR: the switch, with how to make a list with `DARNER_LAND_READS`, not a ready-made list. The keep list filled from the title's readback buffers (section 3 of the issue) is still the aim; this shows what leaving memory on the card at the declaration is worth.
Author

City run, following the preview above. #310 is now open as a draft with this in it.

Same list and settings, 10 min, into the city from about the second minute, with #310 and #274 in the build (and #283, inactive with Reflex off).

  • Copy-back about halves in every draw band, the city's included: 8.2 ms a frame above 9,000 draws (A runs: 16.2 / 13.1), 6.8 ms at 7,000-9,000 (12.0 / 10.9), 6.0 ms at 5,000-7,000 (9.9 / 10.2). wc to copy back, median, 94 MB a frame (159 / 149). No visual faults.
  • The city's stutter is not the landing. Frames over 50 ms above 9,000 draws: 14.0 % (A: 9.5 / 10.1 %). Per minute they follow the texture queue: 0.4 % in a minute with 2,810 slots queued and 227 waiting for their memory; 16.7 % in one with 11,330 queued and 2,748 waiting. I'm looking at the texture side next (room line, upload rate, parking), from the logs first.

On the title's side (section 3 above): the readback ring helper is hooked in a local build (off by default, DARNER_READBACK_HOOK=1, the entry checked by its first bytes as #185 and the mouse hook do), and every buffer it makes is kept: the leave list never leaves a part of one. The next run logs how many there are, how big, from which callers, and whether any of them fall in the census-made list.

City run, following the preview above. #310 is now open as a draft with this in it. Same list and settings, 10 min, into the city from about the second minute, with #310 **and #274** in the build (and #283, inactive with Reflex off). - **Copy-back about halves in every draw band, the city's included:** 8.2 ms a frame above 9,000 draws (A runs: 16.2 / 13.1), 6.8 ms at 7,000-9,000 (12.0 / 10.9), 6.0 ms at 5,000-7,000 (9.9 / 10.2). wc to copy back, median, 94 MB a frame (159 / 149). No visual faults. - **The city's stutter is not the landing.** Frames over 50 ms above 9,000 draws: 14.0 % (A: 9.5 / 10.1 %). Per minute they follow the texture queue: 0.4 % in a minute with 2,810 slots queued and 227 waiting for their memory; 16.7 % in one with 11,330 queued and 2,748 waiting. I'm looking at the texture side next (room line, upload rate, parking), from the logs first. On the title's side (section 3 above): the readback ring helper is hooked in a local build (off by default, `DARNER_READBACK_HOOK=1`, the entry checked by its first bytes as #185 and the mouse hook do), and every buffer it makes is kept: the leave list never leaves a part of one. The next run logs how many there are, how big, from which callers, and whether any of them fall in the census-made list.
Author

Where this has gone since the city run above: a census of what the title asked for each piece of its memory, two tries at leaving more of it on the card that failed, and why they failed. Nothing here is a PR yet; it is all on a local branch while the next test runs.

Same PC and settings as above (RTX 4090, i9-14900K, Series X, 1440p, DLSS Quality, frame generation 2x, hardware RT), main f3840d7 with #310, #274 and #341.

The census: what each pool is used for

A local switch notes every XMemVirtualAlloc with the protection, kind and XMem flags the title asked for, and puts the bytes of each of the runtime's paths on the allocation they fall in: shader writes declared and left on the card, pieces landed, the title's first touches of landed pages (DARNER_LAND_READS=1), bytes copied up, and the readback buffers the hooks find. The pools are a handful of big allocations made at start (their addresses move per run). Results of a 900 s run, about 6 minutes of it in the world (the rest on the pause menu):

Memory the title asked for Size Landed Title's first reads of landed pages Readback buffers found
Coherent, graphics read-write (0x22004, flags 0x183) 1,172 MB 1.2 GB 0.2 MB 9,531 buffers
Write-combined, graphics read-write (0x2404, flags 0x283) 2,199 MB 28.3 GB 6.4 MB, one place in the title 583 buffers
Write-combined, graphics read-write (0x2404, flags 0x23) 2,413 MB 13.2 GB none none
Graphics no-access window streaming maps pages into (0x801) 24 GB none none none
  • The CPU reads what the card wrote in coherent memory and in readback buffers; in write-combined memory only through one reader. That reader is the exposure read: it maps a small texture, which is why the buffer hooks missed it. The hook on the engine's map routine now keeps mapped textures as well as buffers.
  • DARNER_WC_NO_BACK at its 1 MB floor already leaves 98.6 % and 99.9 % of the declared writes in the two write-combined pools on the card; what still lands there is the small copies under the floor.
  • Nothing landed from the copies in the PC's memory in any pool.

Leaving more on the card: two tries, both flickered

  1. The write-combined pools and the streaming window as a leave list, made from the allocations at run time (readback buffers excepted). The world flickered badly from the first minute; the UI was stable.
  2. DARNER_WC_NO_BACK with the floor at 0 and the readback buffers (exposure included) excepted. The same: the world flickered, the UI did not.

The census only counted reads by the title's code. Darner reads that memory too: a texture placed in write-combined memory that shaders write is refreshed from title memory, so leaving the shaders' bytes on the card refreshes it from old ones. The 1 MB floor was protecting those textures as much as exposure.

How many textures

A counter in the same census: each texture refresh checks whether the card wrote the texture's memory in a write-combined copy since its last refresh, and whether those writes were left on the card or came back. 10 minutes in the world, normal settings (floor 1 MB, nothing else left):

  • About 80 textures, 4-17 KiB each, under 1 MB together, all in one stretch of about 10 MB of the 0x2404/0x283 pool, near the exposure read.
  • 200-350 such refreshes a second.
  • About 40 of them were refreshed over memory whose writes were left on the card at the 1 MB floor. The counter works per MiB, so that is an upper bound, but some of the stale or wrong textures people see could be this.

For #310: a leave list made from DARNER_LAND_READS cannot see these either, since Darner's own reads are not the title's. A range with such a texture in it would show old texels.

Next

A local switch that registers each texture Darner refreshes from write-combined memory with the readback buffers, so its bytes always come back however the memory round it is treated; then the floor at 0 again. That run is next. If the world stays clean, an A/B against the range-lock run follows and this becomes a PR; if not, the same counter finds the next reader.

Where this has gone since the city run above: a census of what the title asked for each piece of its memory, two tries at leaving more of it on the card that failed, and why they failed. Nothing here is a PR yet; it is all on a local branch while the next test runs. Same PC and settings as above (RTX 4090, i9-14900K, Series X, 1440p, DLSS Quality, frame generation 2x, hardware RT), `main` `f3840d7` with #310, #274 and #341. ### The census: what each pool is used for A local switch notes every `XMemVirtualAlloc` with the protection, kind and XMem flags the title asked for, and puts the bytes of each of the runtime's paths on the allocation they fall in: shader writes declared and left on the card, pieces landed, the title's first touches of landed pages (`DARNER_LAND_READS=1`), bytes copied up, and the readback buffers the hooks find. The pools are a handful of big allocations made at start (their addresses move per run). Results of a 900 s run, about 6 minutes of it in the world (the rest on the pause menu): | Memory the title asked for | Size | Landed | Title's first reads of landed pages | Readback buffers found | |---|---:|---:|---:|---:| | Coherent, graphics read-write (`0x22004`, flags `0x183`) | 1,172 MB | 1.2 GB | 0.2 MB | 9,531 buffers | | Write-combined, graphics read-write (`0x2404`, flags `0x283`) | 2,199 MB | 28.3 GB | 6.4 MB, one place in the title | 583 buffers | | Write-combined, graphics read-write (`0x2404`, flags `0x23`) | 2,413 MB | 13.2 GB | none | none | | Graphics no-access window streaming maps pages into (`0x801`) | 24 GB | none | none | none | - The CPU reads what the card wrote in coherent memory and in readback buffers; in write-combined memory only through one reader. That reader is the exposure read: it maps a small **texture**, which is why the buffer hooks missed it. The hook on the engine's map routine now keeps mapped textures as well as buffers. - `DARNER_WC_NO_BACK` at its 1 MB floor already leaves 98.6 % and 99.9 % of the declared writes in the two write-combined pools on the card; what still lands there is the small copies under the floor. - Nothing landed from the copies in the PC's memory in any pool. ### Leaving more on the card: two tries, both flickered 1. The write-combined pools and the streaming window as a leave list, made from the allocations at run time (readback buffers excepted). The world flickered badly from the first minute; the UI was stable. 2. `DARNER_WC_NO_BACK` with the floor at 0 and the readback buffers (exposure included) excepted. The same: the world flickered, the UI did not. The census only counted reads by the **title's** code. Darner reads that memory too: a texture placed in write-combined memory that shaders write is refreshed from title memory, so leaving the shaders' bytes on the card refreshes it from old ones. The 1 MB floor was protecting those textures as much as exposure. ### How many textures A counter in the same census: each texture refresh checks whether the card wrote the texture's memory in a write-combined copy since its last refresh, and whether those writes were left on the card or came back. 10 minutes in the world, normal settings (floor 1 MB, nothing else left): - **About 80 textures**, 4-17 KiB each, **under 1 MB together**, all in one stretch of about 10 MB of the `0x2404`/`0x283` pool, near the exposure read. - 200-350 such refreshes a second. - About 40 of them were refreshed over memory whose writes were **left** on the card at the 1 MB floor. The counter works per MiB, so that is an upper bound, but some of the stale or wrong textures people see could be this. For #310: a leave list made from `DARNER_LAND_READS` cannot see these either, since Darner's own reads are not the title's. A range with such a texture in it would show old texels. ### Next A local switch that registers each texture Darner refreshes from write-combined memory with the readback buffers, so its bytes always come back however the memory round it is treated; then the floor at 0 again. That run is next. If the world stays clean, an A/B against the range-lock run follows and this becomes a PR; if not, the same counter finds the next reader.
Author

Follow-up to the post above: the texture run, and how low DARNER_WC_NO_BACK's floor goes.

Keeping the textures is not enough. With the 81 textures the counter found registered and always copied back (the run's log confirms all 81), plus the readback buffers, the floor at 0 still made the world flicker as before. So those textures were not the only reader.

The floor, with the textures and readback buffers kept (DARNER_READBACK_HOOK=1 and the local texture switch; same PC and settings as above):

DARNER_WC_NO_BACK_MIN_KB World
0 flickers from the start
64 clean, about 3.5 min in the world (heavy scenes, 7,900 draws a frame on average)
256 clean, about 1 min
1024 (the default) clean

What goes wrong at 0 lies in write-combined copies under 64 KB. My main suspect now is overlapping host copies: when one copy's shader writes stay on the card, other copies over the same title memory never get them (with the write-back they did, through title memory). A census of exactly that is building; it runs at the normal floor, so it needs no flickering run.

The 64 KB tries are short checks for flicker, not an A/B. A proper 10-minute A/B of 64 KB against the range-lock run is next, once the census has said what is left under it.

Follow-up to the post above: the texture run, and how low `DARNER_WC_NO_BACK`'s floor goes. **Keeping the textures is not enough.** With the 81 textures the counter found registered and always copied back (the run's log confirms all 81), plus the readback buffers, the floor at 0 still made the world flicker as before. So those textures were not the only reader. **The floor, with the textures and readback buffers kept** (`DARNER_READBACK_HOOK=1` and the local texture switch; same PC and settings as above): | `DARNER_WC_NO_BACK_MIN_KB` | World | |---|---| | 0 | flickers from the start | | 64 | clean, about 3.5 min in the world (heavy scenes, 7,900 draws a frame on average) | | 256 | clean, about 1 min | | 1024 (the default) | clean | What goes wrong at 0 lies in write-combined copies under 64 KB. My main suspect now is overlapping host copies: when one copy's shader writes stay on the card, other copies over the same title memory never get them (with the write-back they did, through title memory). A census of exactly that is building; it runs at the normal floor, so it needs no flickering run. The 64 KB tries are short checks for flicker, not an A/B. A proper 10-minute A/B of 64 KB against the range-lock run is next, once the census has said what is left under it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner#287
No description provided.