Repository navigation
Slot eviction counts the card's use as the texture queue does (#3829) - #3848
Trillazill wants to merge 3 commits into
Conversation
…o1-coder#3829) The texture queue counted what is kept for card copies of title buffers and for render targets as used; slot eviction did not. With trustno1-coder#3829's figures (8 GB card) the queue said "no room, new textures wait" at 5,365 MB against 5,272 MB while eviction saw 4,621 MB against 5,251 MB and never started, so the waiting textures were never given room and flickered black. Both now count through queue_use. VICTORY_SLOT_EVICT_KEPT=0 goes back to the count without the reserves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The 50% clamp can still put the eviction start above the texture queue’s byte line. At a 6,910 MiB budget with Follow-up 267a5f6 uses the queue’s exact byte line to bound the start in that path. It keeps the lower stop line, the per-pass cap and the existing percentage path for explicit caps and A separate below-budget case is the raw |
| // against eviction's 5,251 MB; on an 8 GB card the waiting | ||
| // textures flicker black). `VICTORY_SLOT_EVICT_KEPT=0`: as | ||
| // before, without them. | ||
| let used = if crate::toggled!("VICTORY_SLOT_EVICT_KEPT") { |
There was a problem hiding this comment.
The logged arithmetic can disagree with actual admission. #3829's quoted line includes 1,238 MiB in texture copies. At a 6,910 MiB DXGI budget, texture_floor_bytes is 1,727.5 MiB. The full room() returns true before comparing the counted usage. The diagnostic in host.rs prints no room from the arithmetic alone. I corrected my earlier issue comment to account for that. Corrected #3829 analysis
I ran the exact admission and eviction planning blocks on Windows with injected memory figures. The other figures stay at #3829's quoted values.
| Texture copies and setting | Actual room() |
Main eviction | 055615f / 267a5f6 |
With reserve counting gated |
|---|---|---|---|---|
| 1,238 MiB, default | Allows | Off | Requests 256 MiB | Off |
| 2,000 MiB, default | Refuses | Off | Requests 256 MiB | Requests 256 MiB |
| 2,000 MiB, explicit 2,048 MiB texture cap | Allows | Off | Requests 256 MiB | Off |
In 267a5f6, the conditions under align select the threshold, but the plan can still add the reserves before hitting that gate. Could the same conditions gate counting the reserves as well? I checked that change in the fixture. It preserves the old eviction calculation under the floor or with an explicit texture cap, and still starts the new plan when actual budget admission refuses in the middle case.
For the 8 or 10 GB hardware A/B, recording held back for room, first-upload room decisions, and the eviction/recreation count would help distinguish a real upload refusal from the diagnostic line.
If you reuse the regression case or gate change, please retain its authorship with Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>.
There was a problem hiding this comment.
Retested the exact a9980e6 head on Windows with diagnostics. The resource and pool suites passed 75 tests, with four ignored. The regression covers the automatic floor, real budget admission, and the explicit cap cases.
I also checked the two hardware logs from the earlier 055615f head. With KEPT=0, 27 of the 33 diagnostic no room lines were below the floor, but the actual indexed-texture pass still recorded 107,868 held back for room events across the capture. With KEPT=1, all 10 diagnostic lines were below the floor and that counter stayed at zero. Those are repeated admission events, so they should be read as counts of work being held back. Matched hardware logs
The revised head resolves the planning case I raised. The hardware comparison with that head is still needed to see whether the initial reset burst and the flicker change.
|
VectorMan896 ran a useful hardware control on the RTX 4060 Ti by changing only the existing start percentage to 66. Eviction was active in 29 of 37 checks versus 0 of 137 in the earlier runs. The sampled-slot counter recorded 49,780 resets, with 12,150 queued again when read. The texture-level counter reported zero. Flicker was reduced and still visible. The run started with more available system commit, so its FPS difference is hard to attribute. 8 GB hardware report I also checked the uploaded control log. All 12 That shows why starting the pass can help on this setup and why the requeue count belongs in the comparison. It was a test of the existing percentage switch. The reserve-counting change in this PR still needs a direct run. @Lancito01 Thanks for offering the RTX 3080 test. Once the reserve-counting gate is settled, could you compare the same build and route with |
|
Tested 055615f on the 8 GB card from #3829 (RTX 4060 Ti 8 GB, driver 621.01, Ryzen 5 5600X, 32 GB). Built from the PR head with
The commit free at the start was the same for both runs (30.0 / 30.2 GB). The change does what it says. With But the flicker was not better: by eye it was a bit worse with The requeue count may explain it. As before, all the freeing is the sampled pass: the texture-level pass takes nothing (every look finds idle textures it may not take because a slot shaders pick by index shows them). Over the run, 25 % of the nulled slots were queued again when a shader read them. Most of the nulling comes in one burst about a minute in, then the requeues keep growing at roughly 1,000 every 30 s: If a nulled slot is sampled before its texture is back, it would draw black, which looks like the flicker being reported. So on this card the start gate is fixed, but which slots the sampled pass lets go of may now matter more than when it starts. The first burst fits the "right after a world loads" case in the PR's "What to watch" section. Logs ( |
|
Logs for the two runs above (KEPT=0, KEPT=1): |
After the texture floor is reached, bound the counted eviction start by the automatic queue's exact line. The 50% minimum of the rounded policy can put eviction above that line once face headroom is subtracted. Keep separate start and stop thresholds and retain the percentage plan for the legacy switch and explicit texture budgets. Test the equality boundary, the capped pass, and the lower stop line.
…-coder#3848 review) room() admits before it compares its count with its line when the texture copies are under the floor or an explicit texture budget is set. Counting the reserves there started eviction with nothing waiting: trustno1-coder#3829's line showed 1,238 MB of copies, under that card's 1,727 MB floor. reserves_counted() now decides both whether the reserves are counted and whether the queue's byte line bounds the start (the cherry-picked 267a5f6). The test covers the reviewer's three cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, both of you. You're right about the snapshot: I read the Pushed:
I've corrected the description too. The |
|
On the question of a real refusal against the diagnostic line: my logs have the counters you asked for. They come from the texture pass's 5-second line (
So on this card the On One thing that may matter for 8 GB cards: the copies figure on the room lines swings a lot around the floor here, from 264 to about 1,820 MB within one run. With The flicker note from my previous comment still stands: with I can build |
|
Thanks, @VectorMan896. The same-intro The most useful comparison is the texture pass's The revised head passed the Windows policy tests for the automatic floor and the explicit cap. Your earlier run also gives us a separate visual baseline, since clearing the upload holds coincided with slightly more flicker on that head. AI-assisted with OpenAI Codex. |
|
Ran Commit and effective settings (identical for both runs except
I've left out the Flicker, by eye: worse with Around the floor crossing, The same stretch, How I read it (unconfirmed): with Logs below. |
|
An independent 8 GB data point on the exact current head a9980e6. I ran KEPT=0 then KEPT=1 on an RTX 5070 Laptop GPU with the same copied porch checkpoint, input tape, settings, and two copies of the same warm cache. This is a different scene from the intro above. Series S, DLSS Ultra Performance preset M (640×360 to 1920×1080 in the renderer log), frame generation off. Both runs explicitly enabled VICTORY_SLOT_EVICT, VICTORY_SAMPLED_MARKS and VICTORY_SAMPLED_EVICT. Both used the default eviction limits, 75% texture room, and the live DXGI budget (6,924–7,019 MiB in the sampled room logs).
All the baseline holds were in the bucket ending about 10.3 seconds after world entry. Both modes finished that startup pressure episode before the foreground interval, which began at world +27.3 s and +26.3 s. Each had zero upload holds in the complete measured buckets during that steady interval. The two opening captures of that interval show the same black forearm artifact in both modes. This pair exercises both modes through brief startup pressure on the current gate. Treat the steady pacing and requeue differences as single-run measurements. |
|
I independently summed the 4060 Ti logs from One detail from the higher-frequency The exact-head 5070 Laptop pair also removed the startup holds (9,722 → 0) and retained the same visible artifact. Taken together, the reports support earlier upload admission in these cases and leave the visual outcome unresolved. The 4060 Ti report of worse flicker is relevant to the default. A paired AI-assisted with OpenAI Codex. |
|
The paired repeat with
Without the sampled pass, Flicker by eye: I couldn't reliably tell these two apart. I'm working on a way to measure it from the screen rather than by eye, and will post numbers if it gives usable ones. Logs below. |
|
Thanks for the matched control. I checked the two attached With sampled eviction off, upload holds are 135,956 at The extra eviction looks therefore did not relieve upload holds in this control. In the earlier pair with sampled eviction on, the holds fell from 91,903 to 3,395 while sampled-slot requeues rose from 1,732 to 5,551. That makes the sampled-pass interaction relevant to the default. The texture-flicker result is still an observation from the earlier pair, and the frame timings here come from one run per setting. |
…ard's use as the texture queue does (trustno1-coder#3829) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What this changes
The texture queue (
resource::room) and slot eviction (resource::slot_evict) count the card's memory in use differently:used - free in texture blocks + kept for card copies of title buffers + kept for render targets, againstroom_line - face headroom;used - free in texture blocks, againstmin(VICTORY_SLOT_EVICT_PERCENT, that same line as a percent).The lines are nearly the same, but eviction leaves out what the queue keeps. With #3829's figures (RTX 4060 Ti 8 GB, budget 6,910 MB) the queue saw 5,494 − 873 + 115 + 629 = 5,365 MB against 5,272 MB and said
no room, new textures wait. Eviction saw 5,494 − 873 = 4,621 MB against its start line of 76 % (5,251 MB) and never started. The textures then wait with nothing making room for them; on that card they flicker black (0 of 137 looks decidedevictingacross three runs). A comment in the issue replayed the same numbers throughroomandslot_planin the issue.Now both count through one function,
queue_use, so eviction starts where the queue says there is no room.VICTORY_SLOT_EVICT_KEPT=0goes back to the old count.After review
no roomdiagnostic is arithmetic only.room()admits before that comparison while the texture copies are under the floor (a quarter of the budget, 1,727 MB there) or an explicitVICTORY_TEXTURE_BUDGET_MBis set. 8 GB RTX 4060 Ti: black flicker on skin, eyes, shadows and orange jumpsuits in the intro; slot eviction never starts on v2026.11.29.05 while the queue says "no room" #3829's line showed 1,238 MB of copies, so at that exact snapshot the queue was not refusing.reserves_counted): eviction counts them, and starts at the queue's line, only with copies at or past the floor and no explicit texture budget, i.e. exactly whereroom()compares the counted use. Elsewhere it plans as on main.VICTORY_TEXTURE_ROOM_PERCENT=50the clamp had put eviction above the queue's line.With #3829's card figures and the copies past the floor, eviction starts and lets go of up to 256 MB a pass (
VICTORY_SLOT_EVICT_MB), down to the low line (4,856 MB).What it does not change:
room; the arithmetic moved intoqueue_useunchanged);What to watch
The reserves count as use while they are kept. Right after a world loads, the render-target reserve (2.5 GB on cards with a budget of 8 GiB or less) can be most of what counts. Eviction can then let go of idle textures while the targets are still coming. It already stopped short of the queue's line before; now it reaches it. The reserve is given up once the targets settle (
VICTORY_CARD_ROOM_FOR_TARGETS_SETTLE_MS, 20 s). The "made again (within 2 s)" count in the slot-eviction line shows if that costs re-uploads.Tests
resource::tests::slot_eviction_starts_where_the_queue_says_no_room, on 8 GB RTX 4060 Ti: black flicker on skin, eyes, shadows and orange jumpsuits in the intro; slot eviction never starts on v2026.11.29.05 while the queue says "no room" #3829's figures. Without the reserves eviction stays off; counted as the queue counts, it starts, capped at a pass's bytes.resource::tests::the_reserves_count_only_where_the_queue_counts_them, the review's three cases (1,238 MB default: off; 2,000 MB default: on, 256 MB; 2,000 MB with an explicit texture budget: off) andVICTORY_SLOT_EVICT_KEPT=0. From 267a5f6:resource::tests::slot_eviction_can_open_room_at_the_exact_byte_line.cargo test -p victory-gpu --lib -- resource:: pool::: 74 pass, 1 fails (host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue, which the filter catches; it passes alone and does not touch this code).cargo test -p victory-gpu --no-fail-fast: 921 pass, 2 fail.shader_cache::tests::every_switch_of_the_translator_is_in_the_keyfails the same way on 41adb55.host::card_steps::tests::places_written_after_sending_are_learnedfailed in the full run and passed alone three times out of three; it does not touchresource.rs. (In another full run the same way,host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queuewas the one: the suite has tests that share process-wide state.)cargo xtask policy --staged: ok (1 file).-p victory-gpu --lib --tests --features diagnostics): nothing in the lines this change adds or touches. Main at 41adb55 already stops-D warningsinvictory-shader.VICTORY_VRAM_BUDGET_MB=6910(diagnostics build, Series X): the reserves fell to 0 MB within the first ~30 s in the world, and the card sat over the capped budget (7.5–7.9 GB counted). That is past both the old and the new start line, so this run does not tell them apart. It needs a real 8 GB card in 8 GB RTX 4060 Ti: black flicker on skin, eyes, shadows and orange jumpsuits in the intro; slot eviction never starts on v2026.11.29.05 while the queue says "no room" #3829's setup. The same run showed something worth knowing for 8 GB RTX 4060 Ti: black flicker on skin, eyes, shadows and orange jumpsuits in the intro; slot eviction never starts on v2026.11.29.05 while the queue says "no room" #3829: when eviction looked, 16,147 of 20,316 idle-looking textures could not be taken because a slot that shaders pick by index showed them. OnlyVICTORY_SAMPLED_EVICT=1lets those go, which is the switch the reporter found reduced the flicker on .02. So on that card this change lets eviction start, and how much it can take still depends on that switch.No game data, logs or other files from the title are in this change.
🤖 Generated with Claude Code