Skip to content

S-5: Normalize DXIL loop back edges for Proton - #60

Merged
ShinniUwU merged 7 commits into
ProjectLeonidaL:mainfrom
JohnReedV:codex/s5-pipeline-worker-stack
Nov 27, 2026
Merged

ShinniUwU merged 7 commits into
ProjectLeonidaL:mainfrom
JohnReedV:codex/s5-pipeline-worker-stack

Conversation

@JohnReedV

@JohnReedV JohnReedV commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

S-5: normalize DXIL loop back edges

Pipeline workers overflowed their stacks while converting a generated DXIL control-flow graph with multiple loop back edges from one block or into one header. An 8 MiB worker stack did not resolve the observed failure, so that experiment was reverted. This PR changes the shader emitter to give each loop header a single latch and to split blocks whose back edges reach competing loop headers. It also prevents the final empty-block fold from undoing the normalization.

The changes are focused ports of VIctory PR #2309, commits 364c1bc by powplusplus and 91e3bdf by desplmfao. The commits here preserve their author credit. Existing nonallocating successor traversal is reused.

Validation so far:

  • Linux shader library tests: 176 passed, 2 ignored.
  • Windows cross Clippy for all shader targets with -D warnings: passed.
  • Windows shader test executable cross build: passed.
  • Synthetic DXIL bitcode tests under isolated offline Proton: 8 passed, 1 ignored, including the three new loop regressions.
  • cargo xtask policy: 241 files checked.
  • Windows CI: passed.
  • In a full isolated offline game run with the pinned vkd3d-proton 3.2 backend, the previously stalled compute pipeline and a second related compute pipeline both compiled into host pipelines. No pipeline-worker stack overflow occurred during the 13-minute run.

The game advanced through the opening cinematic, then stopped at a separately tracked pool capacity limit before controllable gameplay. This PR resolves the pipeline-worker failure; the remaining pool issue is outside S-5. Test host: NVIDIA RTX 5090, driver 580.173.02, Intel i9-14900KS, Linux/Proton.

AI-assisted. No game files, shaders, screenshots, dumps, or raw logs are included.

@JohnReedV JohnReedV changed the title S-5: Keep pipeline workers alive during world load S-5: Normalize DXIL loop back edges for Proton Nov 26, 2026
powplusplus and others added 3 commits November 26, 2026 15:16
Port of upstream VIctory 364c1bc45c4510d0d07a1e58efaff8644165ded2, itself cherry-picked from d48ec767ba89d27090f6f61d3a9ebfd9f5374def. Reuses Leonida’s nonallocating successors helper.
Port of upstream VIctory 91e3bdfd8f57b2917311583a99d676cc56b0c807 by desplmfao. Keeps one back edge per block and prevents empty-latch folding from undoing the split.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@JohnReedV
JohnReedV marked this pull request as ready for review November 26, 2026 23:43
@ShinniUwU

Copy link
Copy Markdown
Contributor

Looks good. Since this changes the DXIL for every shader (and the empty-latch fold the AMD hang workaround relies on), could you post leonida translate --list --validate failure counts for main and for this branch? Then it's ready to merge.

@JohnReedV

Copy link
Copy Markdown
Contributor Author

I ran leonida translate --list --validate --jobs 8 with no path argument against the same configured full game directory on pinned main b683ea8 and this PR's head 7f45cc2. Both were Windows MSVC release diagnostics builds under Proton 11, with LEONIDA_HOST_WAVE=32 and Microsoft's DXIL validator v1.9.2609.

Stage Main emitted / eligible Main validated PR emitted / eligible PR validated
Vertex/pixel 14,210 / 14,247 14,099 14,210 / 14,247 14,099
Compute 2,725 / 2,734 2,725 2,725 / 2,734 2,725
Mesh 8,762 / 8,765 8,657 8,762 / 8,765 8,657

Both runs found 26,584 containers (614 duplicates skipped) and translated 26,136 programs. Each has 49 emission failures among eligible programs and 216 DXIL validation failures (111 vertex/pixel, 0 compute, 105 mesh). All 26,584 per-container --list outcome lines matched exactly: 0 differences and 0 new failures. This is translator/validator coverage; I have not tested AMD runtime rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants