Findings and patches from a day of testing: texture queue blocking, tiny-copy lag, GPU cost of sampled marks, RT-on device removal bisection (written by Claude) #618
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner#618
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?
Title: Findings and patches from a day of testing: texture queue blocking, tiny-copy lag, GPU cost of sampled marks, RT-on device removal bisection (written by Claude)
Written by Claude (Anthropic) working with me on my PC. Code changes were made against the v2026.12.03.02 source and tested in my own sessions. Numbers come from Darner's own log lines unless marked otherwise. Anything marked (inference) is reasoning, not measured.
PC: Ryzen 7 7800X3D, RTX 4080 SUPER (16 GB), Windows,
darner.exefast build, Series X profile, 1080 → 1440 with DLSS Quality, frame generation 2x, 30 fps cap.Patch with all code changes is attached:
darner-claude-changes-v2.patch. Earlier texture-only patch and logs are in #280.1. Texture queue blocked by one texture (white faces, ground, clothes): bug + fix
Where:
crates/darner-gpu/src/draw.rs,heap_textures(), the pass over textures picked by index.Bug: when
host_resource_for_upload()fails for a slot (no room for its host copy: card past the park's target and PC memory at its floor), the run doesbreak. The slot stays at the head of the due list, so every later run stops at the same slot, and nothing behind it is uploaded, even slots that need no new memory. My log showed 19,500 due, the oldest 1,800 frames, with no run stopped by its time or byte cap.Fix, part 1:
continuepast such slots, up to 64 per run (DEFERRED_PER_RUN).DARNER_DEFERRED_SKIP=0restores the old behaviour.Result: average texture lateness went from 49 frames to about 2–7 across several sessions.
Fix, part 2 (v2): with thousands stuck at once, every run spent its 64 on the same stuck slots and stopped again (about 18,000 such tries every 5 s in one log). Now a failed slot is set aside for 15 frames, keyed by (slot, write). A new write is tried at once, and urgent slots are never set aside.
DARNER_DEFERRED_RETRY_FRAMES(1–600) controls the wait. The 5 s "why runs … took few slots" log line counts slots set aside.Part 2 is built; not yet confirmed in a run with many stuck slots.
The log line "why runs of the pass over textures picked by index took few slots" (new, in
host.rs) counts each exit of the run by reason (time, bytes, commit reserve, upload refused, staging deferred, host texture not made, and so on). That's how this was found.2.
DARNER_NO_NEUTRAL=1(tiny copies) made the game unplayable: fixWhere:
crates/darner-gpu/src/descriptor/noneutral.rs,descriptor/host.rs.DARNER_NO_NEUTRAL=1the game dropped to about 10 fps: about 80,000 tiny copies a minute, all on the frame.DARNER_NO_NEUTRAL_MS(default 2 ms). Over budget, the slot keeps whatmake_atgave instead of a zero copy (newNoTiny::Budget).gather()checks every span's size before reading anything;CACHE_MOSTraised from 512 to 4096.3. Stall stacks in release builds
A game hang once left the log saying only which thread was spinning at 100%. The stall report (
stall.rs) now calls a hook,stall_hook, set by the app todarner_loader::log_stacks. It logs the stacks of up to 3 spinning threads (5 samples, 200 ms apart), or of every thread once. I removed the diagnostics-only gates onunwind_copyandtitle_image_atso this works in release and fast builds.I also added an opt-in sampler for one named thread,
DARNER_THREAD_PROFILE=<start s>,<length s>[,<gap ms>](threaddarner-submitby default). It logs self and inclusivemodule+rvacounts and costs nothing when unset. It's separate from the diagnostics-onlyDARNER_PROFILE.4. Performance findings (settings only)
Medians over whole sessions. Routes were similar but not identical (so treat these as rough).
DARNER_SAMPLED_MARKS=0andDARNER_TEX_RESIDENCY=0(were 1 / 3)DARNER_REFRESH_ADD_SIFT=1(not in README)DARNER_TEXTURE_ROOM_PERCENT=88(default 80 with frame generation)DARNER_UNIFIED_BACKetc. were not tried, given the faces bug noted inplay.rs.darner-submitshowed it inside its work loop about 61% of the time. With marks on, the GPU was the co-limit. (inference from the profile and the Reflex counters)DARNER_INDIRECT_MERGE,DARNER_LAND_SKIPandDARNER_CARD_FORWARDall counted 0 possible gains in my logs.5. Interior lighting without ray tracing
DARNER_PROBE_NEUTRALreplaces the stand-in entirely. Indraw.rs, when it is set,neutral_afterruns and returns beforeambient::after, so every pixel of diffuse probe light becomes one flat grey-white value. There is no room colour, no lamp tint and no crease shade. That gave very flat, colourless interiors here. I'd suggest the README say so.DARNER_AMBIENT_MOST=<1–4>(default 4, unchanged): without rays, caps what the title's resolve leaves at that multiple of the estimate (it was fixed at 4). Indoors that is the probes' stale memory, seen as bright blotches. I use 2. (The link to the blotches is inference.)DARNER_AMBIENT_SPECULARoff, indoor metal and puddles showed blue-white sky speckle. That matches the comment inambient.rsthat misses get the sky's light at 10–30 against 0.01–0.1 for the room.DARNER_AMBIENT_SPECULAR=1,1(the title's sky colour, capped to the room's brightness) plusDARNER_AMBIENT_SPECULAR_BOUND=1is my current choice. It's meant to avoid the green and purple vehicles noted inplay.rs, because the colour stays the title's. (Reasoned from the shader; not fully checked in game yet.)DARNER_AMBIENT_HOLD=0.5(#305) andDARNER_AMBIENT_CHROMA_SCRUB=1, with nothing noticeably wrong.6. RT on: device removed (0x887A0005) within about 20 s to 8 min: bisection
Route: load near a store, open the map, set a waypoint, reverse out, drive. Every run below crashed. With RT off, no crash.
DARNER_TLAS_FRESH=1DARNER_HW_RT_REHYDRATE=0DARNER_HW_RT_LIFT=0(no rays traced)DARNER_HW_RT_BLAS=0HW_RT_BLAS=0+TLAS_INSTANCES=0(an empty TLAS only)DARNER_RT_HARDWARE=0(0 hwrt lines in the log); two long freezes firstDARNER_D3D12_DRED=light, frame generation off: breadcrumbs empty[], "no page fault (a hang)"DARNER_LEAVE_OUTcovering the 2 defaults plus all 78 compute shaders seen in every RT run and not in the RT-off run (the log confirmed they were left out). It crashed about 80 s in. The last trail entries were first binds of mesh and pixel shaders.Ruled out: Darner's DXR structure building, hardware vs software RT, frame generation, and the RT-only compute shaders.
Left (inference):
pipeline/make.rs).I stopped here; logs are available if useful.
7. Other notes
DARNER_TEX_PARK_PHYS_FLOOR_MB=4096andDARNER_TEX_PARK_COMMIT_FLOOR_MB=6144.Attached:
darner-claude-changes-v2.patch, and logs on request.This entire comment and all findings in it were written by Claude (Anthropic), working with me on my PC. I ran the tests; Claude set them up and read the logs. Anything marked (inference) is reasoning, not something a test proved.
Update: RT-on device removal (0x887A0005), more data
PC: Ryzen 7 7800X3D, RTX 4080 SUPER, NVIDIA driver 621.40, GPU at stock (no overclock or undervolt). Other ray-traced PC games run stable. Same Darner build and patch as above, fast profile.
Since the bisection in section 6 above, I ran five more tests with RT on. Every one crashed with
0x887A0005.1.
34992f2b65a789a5left out: still crashesTurning RT on switches
DARNER_EXACT64from71883e40620a567a+7168dd781ca7efb9to1(play.rs). That makes34992f2b65a789a5run only with RT on: with RT off the log says "shader does not translate; its pipelines' draws are dropped". It wasn't in my earlier list of 78 RT-only compute shaders, because it still logs a "first bind" with RT off.With it added to
DARNER_LEAVE_OUT, the log shows no translation and no host pipeline for it, and the game still crashed after about 5 minutes.2. No RT-only graphics shaders
All 1,575 graphics (mesh, pixel and vertex) shaders bound in a crashing RT run were also bound in RT-off sessions that ran for 30+ minutes without crashing. So there's nothing RT-only to bisect among the graphics shaders.
3.
TdrDelay=10: not a timeoutWith
TdrDelay=10set inHKLM\SYSTEM\CurrentControlSet\Control\GraphicsDriversand the PC restarted, the device was still removed after about a 1.7 s stall, well under 10 s. Windows' System log has no Display 4101 and no nvlddmkm entry at the moment of the crash.4.
DARNER_D3D12_DRED=1: empty breadcrumbsWith hardware RT and full DRED:
device-removed data (faulting address kept true, breadcrumbs kept true); no page fault (a hang or a reset, not a bad address); breadcrumbs (done/count, list) []There were 20 of Darner's submissions still on the card.
5. D3D12 debug layer: removal reason
Diagnostics build,
DARNER_D3D12_DEBUG=1, Graphics Tools installed (tools.graphics.directx~~~~0.0.1.0). The debug layer gives the removal reason as:ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_REMOVED: Plug-and-play stop has been exercised on this adapter. Odds are good that the adapter might no longer be available).No validation message stands out just before it.
Separate finding: resource-state errors (not RT-specific)
The debug layer reports steady severity-1 errors in both modes. They don't explain the RT crash, but may be worth fixing on their own:
ExecuteCommandLists: Using SetComputeRootShaderResourceView ... Resource state D3D12_RESOURCE_STATE_COPY_DEST (promoted from COMMON state) ... is invalidCopyBufferRegion: Resource state D3D12_RESOURCE_STATE_COPY_DEST (assumed at first use) ... is invalid for use as a source bufferNon-simultaneous-access Texture Resource ... still referenced by write GPU operations in-flight on another Command Queue ('nv.sl.dlss_g.cmdQ.game')GetResourceAllocationInfo: D3D12_RESOURCE_DESC::Alignment cannot be 64KB ...(severity 2)Summary
34992f2b65a789a5, RT-only graphics shaders (there are none), a 2 s timeout, and the resource-state errors above.