Repository navigation
Conversation
…st encode A stage's dirty flags say what changed since the stage last encoded an argument block, not since a given shader did. Another variant of the same program (no program switch, so no args_dirty_all) could encode in between and clear them, and the first variant then reused, or patched for uniforms only, a block from before the binding change. Each stage now remembers the shader whose block it last encoded, patched or reused (g_last_sh); a refused reuse is counted (@args_refused in the trace rows). Found by reading seedds#1898's 56e7ee1, which has the same rule. t_args_last_sh runs the sequence (A, a binding change, variant B, A): it fails without the change (A's second dispatch writes the old binding) and passes with it. No game failure seen.
…combined program never takes the bound one's ring slot (PR #2249) A stage's binding changes were flags (g_args_dirty, g_args_ubo) that whichever shader wrote the stage's next block cleared, so they said nothing about another shader's block: a binding change, another shader's encode on the stage, then the first shader again reused a block from before the change. Each change now takes the next number of one sequence for every stage (g_args_gen for any binding, g_args_ugen for what the uniform slots point at only); a block keeps the numbers it was written at and is reused only while both hold, patched when only the uniform one moved. On main every path that puts another shader on a stage marks the stages first, so the one route found was bind_stages: when the bound combination was the next ring slot to be replaced, a new combination came back as the same pointer and OP_BIND_PROGRAM (np != S.prog) saw no change. It now skips that slot. No game failure seen; t_args_gen covers the sequence, shaders taking turns, a uniform-only change and the slot (its slot checks fail without the bind_stages change). Regression: OCTOPATH TRAVELER II as main when no other run shared the Mac (19 long frames in 50-130 s, battle reached; runs overlapping other sessions' jobs stalled on main too); Fire Emblem: Three Houses shader check only (no route). Co-authored-by: Pedro Nascimento <91118+lunks@users.noreply.github.com>
|
Thanks: the diagnosis holds. A stage's dirty flags were cleared by whichever shader wrote the stage's next block, so they said nothing about another shader's block. Landed in a different form in f31276a, crediting you as co-author. What I found on main: the trigger in the description doesn't occur there. Alpha, logic and border handling are flags and bindings on one What landed:
Regression: OCTOPATH TRAVELER II ran as main when no other job shared the Mac. |
…r was the stage's latest encode (Pedro Nascimento) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
seedds#2182, seedds#2225, seedds#2194, seedds#2273 (mkw/sets.tsv) Each corrects wrong behaviour on code this game runs and brings a test that fails without it or a measurement; none changes the shader chain. Built on this Mac with 58 warnings as upstream; t_fstep passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
…r was the stage's latest encode (Pedro Nascimento) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
seedds#2182, seedds#2225, seedds#2194, seedds#2273 (mkw/sets.tsv) Each corrects wrong behaviour on code this game runs and brings a test that fails without it or a measurement; none changes the shader chain. Built on this Mac with 58 warnings as upstream; t_fstep passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
…r was the stage's latest encode (Pedro Nascimento) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
seedds#2182, seedds#2225, seedds#2194, seedds#2273 (mkw/sets.tsv) Each corrects wrong behaviour on code this game runs and brings a test that fails without it or a measurement; none changes the shader chain. Built on this Mac with 58 warnings as upstream; t_fstep passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcmewFJDrDUooyBk9ygMAv
What and why
A stage's dirty flags (
g_args_dirty,g_args_ubo) say what changed since the stage last encoded an argument block, not since a given shader did. A program switch dirties every stage, but a variant of the same program (an alpha, border or logic library) is anotherNvShaderwith its own block and no program switch between. Variant A encodes, a binding changes, variant B encodes and clears the flags, A draws again with nothing flagged: it reuses its block, or its copy patched for uniforms only, from before the change, so a draw can bind an old texture or uniform.Each stage now remembers the shader whose block it last encoded, patched or reused (
g_last_sh, forgotten byargs_dirty_all), andencode_args_reuses or patches a block only for that shader. A refusal is counted (@args_refusedin the trace rows); it is an upper bound, since it also counts refusals where nothing changed. The rule is ruslan-kyrylyuk's, from #1898's 56e7ee1; this is the change on its own, with a test, and the patch path covered too.No game failure is attributed to it: it was found by reading. The cost is a full encode instead of a reuse after a variant alternates in a stage.
Checked
t_args_last_sh(15 checks) runs the sequence A, binding change, B, A: it fails without the change (A's second dispatch writes the old binding; 3 checks) and passes with it.make -C dm/gfx/tests GAME=0400486024DEC000 check_t_args_last_sh check_t_geometry check_t_feedback check_t_dispatch_own check_t_nvnpass;docs_symptoms.py --checkandtest_docs.pypass.regress.py impact origin/main..HEADreaches every NVN entry point throughencode_args_, so this is a change every game takes; noregress.py checkreport: games are not run here. A run on a game that alternates variants of one program would show whether@args_refusedis ever above 0.Docs
docs/reference/rendering.md("An argument block reused after another variant of its program encoded"), anddocs_symptoms.pywas run