startup: count native slot 57 preparation outcomes #3483
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3483"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T17:20:50Z.
Refs #3416.
In a long local run of the application, native slot 57 preparation produced no log line at all: most exits of
prepare_native_mesh57are bare returns, and the only lines arereadyandrefused: ...once a profile has been opened. It was not possible to tell which early return was taken.Each slot 57 creation now adds one to the counter of the first exit it takes. No behaviour change: the same returns and throws, with the same messages.
Outcomes
disabled: built withoutX2W_NATIVE_SHADERS, render mode off, or theX2W_NATIVE_SHADERSvariable unset or too long.unsupported_stage_or_descriptor: no pipeline record, no fixed mesh stage, or a descriptor that is not 0x300 bytes.ps_absent: no fixed pixel stage.missing_creation_root_or_state: creation root signature not usable, state sizes differ, or no root blob recorded.profile_absent: no cache path, or the cache listing has no.mesh57-statefor the variant.profile_open_failed.profile_rejected_*, one per check on the profile:header,pixel_entry,version,constants,root_mapping,view_count,view_entries,view_mapping,heap_mapping,input_length,input_content,trailing_bytes,attachment_state,creation_root, andexceptionfor any otherstd::exceptionbefore lowering.lowering_refused: an exception from the mesh translation, the binding checks after it, or the pixel stage translation and its checks.pipeline_refused: an exception from the DXIL compile, the root signature or the pipeline state.ready.lowering_reachedis a milestone, not an exit: it is counted when a profile passed every check, so it overlapslowering_refused,pipeline_refusedandready.The combined
!info || !fixed_ms || !fixed_ps || size != 0x300return is split in two so thatps_absenthas its own counter; the set of creations that return there is the same.Output
One line in the existing render-totals block (every 300 presented frames in render mode), all counters, zeros included:
Counters are 64-bit, written with
InterlockedIncrement64and read withInterlockedCompareExchange64. Astatic_assertties the printed names to the enum. The line holds counts only, no pipeline key.Tests
Base
c4b8a41b, presetdev.native_mesh57_outcomes_warpandnative_mesh57_outcomes_hardware(new,startup_indirect_draw_indexed <backend> meshwithX2W_TEST_NATIVE_MESH57_OUTCOMES=1): the fixture adds one creation without a pixel stage and compares the whole line. Both pass.Mutations, each rebuilt and run on both backends:
ps_absentcounted asunsupported_stage_or_descriptorprofile_open_failedprofile_rejected_input_lengthlowering_reachednot countedreadycounted aslowering_refusedMerges cleanly with #3480 and #3481 (
git merge-tree).Not covered
ps_absent,profile_absent,profile_rejected_input_content,lowering_reachedandreadycounters are non-zero in the test. The other exits are counted by the same call but no test reaches them.std::exceptionare not caught, as on base.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T06:52:02Z.
Review: APPROVED
Reviewed
78693088by reading the diff; not built or run.Verdict: approve. Every exit of
prepare_native_mesh57now counts exactly once, with the same returns, throws and messages as before. No MUST.x2w-render indirect:totals have a format and an example indocs/startup-runtime.md(~1370, 1497).x2w-render native slot57 preparation:has none, andlowering_reachedoverlapping the terminal counts is easy to misread without a sentence.disabledoutcome for "render mode off" (d3d12_xs_device.cpp:7316-7322) can never show: the line is only logged insideif (render_mode() && frame % 300 == 0)(:7848-7858). In practicedisabledmeans a non-native build orX2W_NATIVE_SHADERSunset or too long. The PR body could say so.returnleft in the function (native_mesh57.inl:354) is inside thematchlambda. Every early return ends innote_mesh57_outcome, and thecatchcountsrefusal.refusalmovesprofile_exception→lowering_refused→pipeline_refusedat the right points.ps_absentsplit keeps the same set of returning creations.note_mesh57_outcomeandmesh57_outcome_linesit outside the#ifdef X2W_NATIVE_SHADERS(:262), so theelsebranch in the placeholder still compiles.log()'s own 1536. Thestatic_assertties the names to the enum.fields[5]/[6], so the later expectations are unchanged.Tests:
native_mesh57_outcomes_{warp,hardware}compare the whole line after one PS-less creation, 64 absent profiles, one content mismatch and one ready pipeline. The zeros are pinned too, but the other exits are never reached. CI did not run them: neither is in theprpreset filter.