Repository navigation
startup: count native slot 57 preparation outcomes - #3483
Merged
Merged
Conversation
lukaslw-lab
approved these changes
Nov 30, 2026
lukaslw-lab
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 78693088 by reading the diff; not built or run.
Verdict: approve. Every exit of prepare_native_mesh57 now counts exactly once, with the same returns, throws and messages as before. No MUST.
- SHOULD Document the new line. The sibling
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. - NIT The
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. - Checked, no finding:
- Exit coverage: the only bare
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. - The
ps_absentsplit keeps the same set of returning creations. - Build without native shaders: the counters,
note_mesh57_outcomeandmesh57_outcome_linesit outside the#ifdef X2W_NATIVE_SHADERS(:262), so theelsebranch in the placeholder still compiles. - Line length: about 750 characters, under both the 1536-byte buffer and
log()'s own 1536. Thestatic_assertties the names to the enum. - Test: the extra PS-less creation is inserted before the existing ones and restores
fields[5]/[6], so the later expectations are unchanged.
- Exit coverage: the only bare
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 the pr preset filter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.