You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
startup: four runtime diagnostics missing in a long run (direct-draw refusal census, snapshot pool totals, clear census, memory SRV shape table) #3477
One local run of the application (about 1,430 s, runtime at 36914379) left four questions the logs could not answer. Line numbers are on mainc4b8a41b. Counts only.
Direct draws not drawn, per (pipeline key, reason).
Code: note_draw_refusal returns at once unless X2W_PIPELINE_COLOUR is on (src/startup_stubs/d3d12_draw.inl:2968-2974). The counters untranslated_draws and translation_missing (:240, :3793, :3966) carry no key and no reason.
Run: 2,311,629 direct draws not drawn, 573 pipelines missing. The only per-key output is 12 capped no translation for pipeline lines.
Change: note (key, fixed reason code) in a PerReasonRefusalCensus at the not-drawn increment, independent of the debug switch, and report it with the other censuses.
Snapshot pool totals and refusals.
Code: in reserve_upload_ring, note_reserved skips the snapshot pool (src/startup_stubs/d3d12_xs_device.cpp:2778-2779), the refusal counter is ring-only (:2866), and the refusal line is logged 8 times (:2867-2870).
Run: 8 refusal lines, the first at about 132 s, then none for the rest of the run; the compute census then shows 10,930 dispatches refused because an input could not be copied.
Change: count pool reservations, bytes and refusals, and print them on the upload ring totals line.
Clear colour and target census.
Code: list_clear_target logs the first 4 calls only (src/startup_stubs/d3d12_xs_device.cpp:4285-4288).
Run: 284,826 clears, 4 logged.
Change: a bounded table of distinct (colour, target format) pairs with counts, reported with the render totals.
Memory SRV census: shape table full.
Code: max_shapes = 128 (src/startup_stubs/memory_srv_census.h:91); later shapes only add to the "calls past the shape table" count (:111, :142).
Run: 128 shapes; 5,455,551 of 8,985,300 refusals (61%) fall past the table. The buffer shapes that fill it differ only by size.
Change: key buffer shapes by size class, or keep the past-the-table count per reason.
Each item will come as its own small PR with a test.
Not covered here: ExecuteIndirect refusal causes (#3405 / #3411) and the refused-SRV cache (#2782).
Adding a fifth item, line numbers on main26df1826:
Sampled colour of the presented surface, logged when it changes.
Code: present_signature (src/startup_stubs/d3d12_xs_device.cpp:7540-7580) already samples the presented surface, but the sample only goes to the shared block (publish, src/startup_stubs/present_signature.h:121-129). The sampled RGBA is logged only under the red-producer diagnostic (:7560-7570).
Run: in one long local run of the application the picture went from a uniform fill to black, and no log line says so.
Change: one bounded log line when the sampled colour changes (present number, RGBA), independent of the red-producer switch.
Adding a sixth item, line numbers on main26df1826:
Native shader compiles: count, time, and refusals past the logged ones.
Code: the first Dispatch of a compute key translates it under draw_lock (src/startup_stubs/d3d12_compute_dispatch.inl:796, :812), DXC compile included (:584-587); native graphics does the same from draw_translated (src/startup_stubs/d3d12_draw.inl:3116-3118, try_native_graphics at :1296 and :1314). Neither path records a duration. refuse_native logs the first 16 compute refusals only (d3d12_compute_dispatch.inl:486-488); later ones are counted nowhere by reason.
Run: in one long local run of the application with native shaders enabled, 84 compute programs were translated natively and about 270 were refused, 16 of them logged; frames stopped about 42 s before the run ended, and the log cannot say whether compiles held the lock.
Change: one totals line with native compiles (count, total and max ms, compute and graphics apart), time spent on native work under draw_lock, and native compute refusals per reason beyond the 16 logged lines.
Adding a seventh item, line numbers on main1b8e2fee:
Native graphics: name the stage interface lookup that failed.
Code: prepare_direct_graphics (src/direct_compute_cache.cpp:594) looks up one companion per stage, first as a pinned container (:626-627), then in the reviewed interface catalog (:632-634), keyed by exact code digest and then by embedded ID (:279-281). The lookup is skipped when there is no cache directory or a stage is DXBC (:624). With nothing pinned, a catalog hit for one stage only is discarded (:636). A fixed pixel entry without companions then throws fixed graphics entry requires matching stage interfaces (:700-702), the same text for every cause.
Run: in one long local run of the application with native shaders enabled, all 46 native graphics attempts were refused with that message and none became ready; the log cannot say which lookup failed.
Change: name the cause in the refusal (lookup skipped, no catalog loaded, vertex stage not found, pixel stage not found, one stage found and discarded because its partner was missing), and add a per-cause count to the totals. A catalog tie already has its own message (:283). No change to what is accepted.
Adding an eighth item, line numbers on main77d63db8:
Debugger trace: thread id on traced-call and exception lines.
Code: a --trace-calls 1 call is described at entry (tools/startup/debug_launch.py:711-712 for the runtime module, :529 for the movie player) and written when it returns (:763-765) with the time since launch and the result only; the thread id is known there (returns.add(ret, tid, ...), :761) but not printed. The exception line (:1055-1056) and the debugger stop line (:1085) omit it too, while LOG_AT (:659) and thread creation (:988) print it. The one time on a call line is taken at return, so the gap between two calls on a thread cannot be read from the log.
Change: add tid= to traced-call, exception and stop lines, and on traced-call lines the time since the previous traced call on the same thread. No change to what is traced or to the hit limits (:524-525).
Adding a ninth item, line numbers on mainff9dcef0:
Native compute outcome per key, written at shutdown.
Code: refuse_native logs the first 16 refusals of the process only (src/startup_stubs/d3d12_compute_dispatch.inl:486-488). The compute census (log_compute_census, :1381-1410) runs only on frames divisible by 300 (src/startup_stubs/d3d12_xs_device.cpp:8032-8039), lists only keys that reached the Dispatch recorder, and carries the first Dispatch refusal, not the native compile outcome. Nothing is written at exit.
Run: in one long local run of the application with native shaders enabled, most compute keys had no native outcome line by the stop.
Change: one uncapped row per compute key with its publication state and native state (not attempted, unavailable, refused with reason, ready), written at controlled shutdown and recoverable on the launcher's forced-stop path (tools/startup/launch.py:314, tools/startup/debug_launch.py:1228), without taking draw_lock at DLL detach. No change to what is translated.
Activity
Leyukaka commentedon Nov 29, 2026
Adding a fifth item, line numbers on
main26df1826:present_signature(src/startup_stubs/d3d12_xs_device.cpp:7540-7580) already samples the presented surface, but the sample only goes to the shared block (publish,src/startup_stubs/present_signature.h:121-129). The sampled RGBA is logged only under the red-producer diagnostic (:7560-7570).Leyukaka commentedon Nov 29, 2026
Adding a sixth item, line numbers on
main26df1826:draw_lock(src/startup_stubs/d3d12_compute_dispatch.inl:796,:812), DXC compile included (:584-587); native graphics does the same fromdraw_translated(src/startup_stubs/d3d12_draw.inl:3116-3118,try_native_graphicsat:1296and:1314). Neither path records a duration.refuse_nativelogs the first 16 compute refusals only (d3d12_compute_dispatch.inl:486-488); later ones are counted nowhere by reason.draw_lock, and native compute refusals per reason beyond the 16 logged lines.draw_lockand adds no timing or counters. This item changes no locking; if startup: translate native compute programs on a worker thread (#3451) #3467 merges first, the compute lock time is dropped and the compile times are taken on the worker.Leyukaka commentedon Nov 29, 2026
Adding a seventh item, line numbers on
main1b8e2fee:prepare_direct_graphics(src/direct_compute_cache.cpp:594) looks up one companion per stage, first as a pinned container (:626-627), then in the reviewed interface catalog (:632-634), keyed by exact code digest and then by embedded ID (:279-281). The lookup is skipped when there is no cache directory or a stage is DXBC (:624). With nothing pinned, a catalog hit for one stage only is discarded (:636). A fixed pixel entry without companions then throwsfixed graphics entry requires matching stage interfaces(:700-702), the same text for every cause.:283). No change to what is accepted.Leyukaka commentedon Nov 29, 2026
Adding an eighth item, line numbers on
main77d63db8:--trace-calls 1call is described at entry (tools/startup/debug_launch.py:711-712for the runtime module,:529for the movie player) and written when it returns (:763-765) with the time since launch and the result only; the thread id is known there (returns.add(ret, tid, ...),:761) but not printed. The exception line (:1055-1056) and thedebugger stopline (:1085) omit it too, whileLOG_AT(:659) and thread creation (:988) print it. The one time on a call line is taken at return, so the gap between two calls on a thread cannot be read from the log.tid=to traced-call, exception and stop lines, and on traced-call lines the time since the previous traced call on the same thread. No change to what is traced or to the hit limits (:524-525).debug_launch.py; this item will be based on it once it merges.Leyukaka commentedon Nov 29, 2026
Adding a ninth item, line numbers on
mainff9dcef0:refuse_nativelogs the first 16 refusals of the process only (src/startup_stubs/d3d12_compute_dispatch.inl:486-488). The compute census (log_compute_census,:1381-1410) runs only on frames divisible by 300 (src/startup_stubs/d3d12_xs_device.cpp:8032-8039), lists only keys that reached the Dispatch recorder, and carries the first Dispatch refusal, not the native compile outcome. Nothing is written at exit.tools/startup/launch.py:314,tools/startup/debug_launch.py:1228), without takingdraw_lockat DLL detach. No change to what is translated.I'm working on this.