Skip to content

docs/boot.md: set LEONIDA_SHADERS in the first-boot commands (without it every pipeline state fails) - #5313

Open
dracbat wants to merge 1 commit into
ItsNotRexed:mainfrom
dracbat:fix/boot-runbook-shaders
Open

dracbat wants to merge 1 commit into
ItsNotRexed:mainfrom
dracbat:fix/boot-runbook-shaders

Conversation

@dracbat

@dracbat dracbat commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #5256 (comment)

What and why

The runbook's Windows and Wine commands set LEONIDA_D3D12=vulkan but not LEONIDA_SHADERS. At main 3faac55, the gta6rt.exe they run has no other way to find the translator's output. So:

  • the Vulkan device logs [rt] d3d12: no translated shaders: set LEONIDA_SHADERS to <work>/shaders/spirv once;
  • every CreateGraphicsPipelineState and CreateComputePipelineState returns E_FAIL.

A first boot that follows the page therefore can't build a frame, and the D3D12 trace doesn't show why, because pipeline creation has no [d3d12-trace] line on main (#4853 adds one).

This adds the variable to both command blocks, and says what it is and what happens without it.

#4333 (RT-287) lets the packaged gta6rt.exe find the shaders through a shader_path.txt beside it. An explicit LEONIDA_SHADERS takes precedence there, so these commands stay right after it lands. And the runtime\build binary the page runs gets no such file.

Tested

Windows 11, AMD Radeon RX 5700 (RDNA1), AMD driver 32.0.21045.29003, MSVC 14.44, Vulkan SDK 1.4.363.1, with gta6rt from main 3faac55 (RelWithDebInfo). A stand-in program creates the Xbox device with D3D12XboxCreateDevice and asks for one graphics pipeline state with a placeholder 16-byte blob. It runs under gta6rt --run --trace-d3d12:

  • With the page's environment (LEONIDA_D3D12=vulkan only), CreateGraphicsPipelineState returned E_FAIL (0x80004005) after the no translated shaders line.
  • With LEONIDA_SHADERS=<work>/shaders/spirv, the device loaded the 26,325 translated shaders of my own copy's build, and the call reached the bytecode lookup: E_INVALIDARG, with shader bytecode holds no FSSM program for the placeholder.

The tests/test_docs_*.py checks (cli_flags, env_vars, links, list_items, repo_paths, table_rows, table_ids, design_rows) pass. The hunks sit apart from the lines #3893, #4424, #4650, #4695 and #4264 change in this file.

AI-assisted: yes (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (N/A: no translator change.)

🤖 Generated with Claude Code

The Windows and Wine commands set LEONIDA_D3D12=vulkan but not
LEONIDA_SHADERS. Without it the Vulkan device logs "no translated
shaders" once and fails every graphics and compute pipeline state with
E_FAIL, so a first boot that follows the page can't build a frame, and
the D3D12 trace doesn't say why. Both command blocks now set it, and the
text says what it is and what happens without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sovljanskii

Copy link
Copy Markdown
Contributor

Fact-checked 32105733 (on main 3faac557) against the runtime and make_game.py, on macOS 27.2 / Apple M4. Docs only, so no boot was run. Pass: every claim holds.

  • LEONIDA_SHADERS is the only source of the shader folder. library() reads info.shader_dir first and falls back to LEONIDA_SHADERS (runtime/shims/d3d12_vulkan_device.cpp:669-677). Nothing in runtime/ assigns shader_dir; its only appearance outside that read is the declaration (runtime/shims/d3d12_com.h:171). The Wine launcher make_game.py installs (WINE_LAUNCHER, gta6rt.sh) doesn't set it either. So both first-boot commands need it, as the PR says.
  • "logs no translated shaders once": d3d12_vulkan_device.cpp:681, guarded by library_tried, so it prints on the first lookup only.
  • "fails every graphics and compute pipeline state with E_FAIL": graphics at :2739-2740 and compute at :3200-3201 both return E_FAIL when library() is null. A precision nit, optional: a PSO that fails an earlier check returns that check's code first. Examples are the center-MSAA pattern (E_NOTIMPL, :2730-2733) and a CS without an FSSM/FSPX program (E_INVALIDARG, :3196-3199). So "every pipeline state that reaches the shader lookup" is the exact form; for a first boot the PR's wording is fine.
  • <work>/shaders/spirv is where the shaders stage writes (make_game.py:1777), and it matches the runtime's own hint at :681 and runtime/README.md:263.
  • The sh block's single-quoted 'Z:\path\to\work\shaders\spirv' keeps single backslashes, which is the same path the double-quoted "Z:\\..." lines produce.

All 10 docs-related test files pass (Python 3.15.2 and the venv's pytest), and git diff --check is clean. AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head 32105733f. git diff --check clean.

  • python -I tests/test_docs_cli_flags.py 3 OK, test_docs_env_vars.py 4 OK, test_docs_links.py 6 OK, test_docs_list_items.py 2 OK, test_docs_repo_paths.py 2 OK, test_docs_table_rows.py 2 OK, test_docs_table_ids.py 2 OK, test_docs_design_rows.py 4 OK.
  • The page's claim matches the code: runtime/shims/d3d12_vulkan_device.cpp:677 reads LEONIDA_SHADERS, and :681 logs [rt] d3d12: no translated shaders: set LEONIDA_SHADERS to <work>/shaders/spirv.
  • The two command blocks now set the variable, and make_game.py documents the translation under <work>/shaders/spirv (line 1091).

Verdict: approve. Docs-only; the explicit variable also takes precedence over #4333's shader_path.txt, as the PR says.

@King1565

Copy link
Copy Markdown

Read 3210573: pass

  • LEONIDA_SHADERS is the only source for a gta6rt run. d3d12_xs.cpp:164-166 builds the device through create_vulkan_device_standalone (d3d12_vulkan_device.cpp:7926), which never sets info.shader_dir. library() then falls back to getenv_s("LEONIDA_SHADERS") (d3d12_vulkan_device.cpp:673-677). When that is empty it logs the quoted line once (:681, guarded by library_tried).
  • Pipeline creation does fail with E_FAIL: graphics at :2739-2740, compute at :3200-3201. <work>/shaders/spirv matches make_game.py:1777.
  • Shell syntax: in PowerShell the double-quoted path has no $, so nothing expands. In sh, single quotes keep the backslashes, so Wine gets the same Z:\... spelling the double-quoted \\ arguments produce.
  • git diff --check is clean and all ten tests/test_docs_*.py pass. git merge-tree against docs/boot.md: the Windows PowerShell 5.1 capture survives ErrorActionPreference Stop (PROC-271) #5330 (also docs/boot.md) merges cleanly.

Read: No defect found. One nuance: compute rejects a desc with no FSSM/FSPX program (E_INVALIDARG, :3196-3198), and graphics rejects bad sample settings (:2730-2737), before the library check. So "every pipeline state" means every one that gets that far, which the PR's own E_INVALIDARG run shows.

AI-assisted (Claude Code).


Generated by Claude Code

@kacper-serewis kacper-serewis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted Windows CPU review at 3210573. From the repo root in Windows PowerShell 5.1, a native probe inherited both documented environment variables and received the executable, package and trace paths containing spaces as intact arguments. Production ShaderLibrary loaded two synthetic entries, one in the main index and one in fspx. The device fallback from LEONIDA_SHADERS was checked by source inspection only; device initialization and retail boot were outside this review.

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.

5 participants