Direct3D 12 back end (nyannoying's experiment): test results on an Intel Arc iGPU, and what a path to main needs #1619

Open
opened 2026-11-18 16:53:18 +00:00 by mooki · 1 comment
Member

Type: feature · Area: renderer, Windows · Part of: #1493

TL;DR

nyannoying's fork has a Direct3D 12 back end that sits behind the same renderer seam as the Vulkan one. We ran its base and head commits on a Windows laptop with an Intel Arc integrated GPU, and built and tested them on Linux. It plays: the title, a save, Kokiri Forest and the Market, in three of four valid D3D12 runs, with one crash at the title that did not repeat. Its native-mesh path hangs the GPU at the same replay operation (668 of 933) as on the author's B580. Neither commit merges into main today. No speed claim is made: these are single cold runs.

Breakdown

  • What this is: a record of the first outside test of the fork's D3D12 back end (commits 5e7d84ab2 and f0f9a048e, the compare nyannoying/[email protected]), kept in one place so the work can be found, discussed and reproduced.
  • What was run: the project's strict whole suite and the fork's own D3D12 tests on Linux; Windows cross-builds of both commits; eight scripted runs on one laptop (Core Ultra 9 185H, Arc iGPU, driver 32.0.101.9175, Windows 11 10.0.26300).
  • What works: D3D12 reached the menu, loaded a save, played Kokiri Forest and reached the Market on both commits. All 13 tests/test_d3d12_*.py pass at both.
  • What does not: the native-mesh path (device removed, the same replay position as on the B580); one host crash at the title in the first head run; one black jagged shape in Kokiri that Vulkan draws as foliage; two Vulkan-side fixtures fail at the head.
  • What is unknown: the cause of the hang and of the crash, any speed comparison with Vulkan (the Vulkan runs timed out at the Market on a cold cache), the debug layer (Graphics Tools is not installed on the laptop).
  • What it would take to reach main: a rebase over 82 commits and the interface version (MKWVK_API_VERSION 29 on the branch, 33 on main; the DLL refuses any other), plus the two fixtures.
  • What we ask: whether the author wants these results as a base for his own issue or pull request, and which of the next steps below he wants help with.

2. What was tested and how

2.1 Scope

We queued the two commits of the compare in our test harness:

  1. Game-free checks on Linux: the project's whole test suite (strict) at the base, the head and current main, plus the fork's own tests/test_d3d12_*.py, plus a Windows-target syntax check of the changed fixtures, plus the third-party provenance check.
  2. Windows cross-builds of both commits (llvm-mingw 20261104, Clang 23.1.5, on a Linux PC): the game, the Vulkan DLL and the D3D12 DLL, with no warnings.
  3. Real runs on one Windows laptop, one game at a time, with an idle probe and AC power checked before every run.

2.2 The laptop

  • Intel Core Ultra 9 185H, integrated Intel Arc Graphics (Meteor Lake iGPU, shared memory, no dedicated VRAM).
  • Graphics driver 32.0.101.9175, the same driver version the fork's notes use for the B580.
  • Windows 11 Pro 10.0.26300, AC power online.
  • The back end's own startup line reported: shader model 6.8, binding tier 3, waves of 8 to 32 lanes, mesh shader tier 10, enhanced barriers yes, relaxed format casting yes, and a video-memory budget of 47,889 MB (that is the shared system memory, not a dedicated pool).
  • The Graphics Tools optional Windows feature is not installed, so the D3D12 debug layer and GPU-based validation could not be used. We did not install it.

2.3 The builds

  • The game is our own cross-build of each commit: v3.0.0-rc.7-32-g5e7d84ab2 (base) and v3.0.0-rc.7-34-gf0f9a048e (head), both reporting renderer interface version 29 on both sides, so the version check refused nothing. Both builds linked without warnings. The shader translator inputs are identical between the two commits (the lift is the same), so only the renderer DLLs and the Eden recompiler files differ.
  • The D3D12 DLL was built with the branch's own gpu/d3d12/build.py (the dev_build.py d3d12 entry stops on a Linux host with "Windows only", so the Linux-hosted llvm-mingw route was used). Both DLLs export mkwvk_init, import only the kernel, user and UCRT libraries plus d3d12.dll and dxgi.dll, and built with zero warnings.
  • Run-time files beside the game: Mesa's spirv_to_dxil.dll (the one in the test package, see section 7) for every D3D12 run, and DXC (dxcompiler.dll and dxil.dll, pinned by the fork with URL and hash, v1.9.2609) only for the native-mesh run.
  • The D3D12 renderer was switched on with RX_D3D12=1 and longshot_d3d12.dll beside the exe, as docs/d3d12.md section 10.1 describes. The test package's README describes a different route (rename the DLL to longshot_vk.dll in a launcher-installed rc.7); we did not run that route because it targets the released exe, which has no such switch.

2.4 The run procedure

Every run used the same scripted session through the game's control bridge, so the arms are comparable in what they did even though one run each is not a statistical sample:

  1. Start with a cold shader/program cache (the folders were new; neither Vulkan nor D3D12 caches existed).
  2. Wait for the title menu, take a picture, press A four times.
  3. Wait for fresh play in Kokiri Forest (limit 240 s), settle 20 s, take a picture, hold 45 s, take a picture.
  4. If the game's clock is under 260 s, teleport to the Market, settle 20 s, take a picture, hold 25 s.
  5. Quit once. Present counts and the host's frame rate are sampled every 2.5 seconds.
  6. A fault line in the game's log (d3d12: device lost, a failed D3D12 call, "back end did not start", FATAL, CRASH) ends the observation.

The caps were 450 s per run and 300 s for the native-mesh run, with that run last on purpose.


3. Results

Run What Verdict What happened
head, Vulkan f0f9a048e, default renderer partial menu at 36 s, save and Kokiri at 66 s, pictures taken; the Market teleport stayed "loading" for 90 s on cold Vulkan caches until the script's wait expired. 754 presents, host fps median 11.8 (9.8 to 12.7). No fault line, exit 0.
base, Vulkan 5e7d84ab2, default renderer partial same as above; save at 53 s, Market load timeout; fps median 13.7 (11.7 to 14.8).
base, D3D12 RX_D3D12=1 ok menu at 29 s, save loaded at 134 s, Kokiri, then the Market reached, four pictures, 1,873 presents, fps median 7.8 (6.8 to 10.8), exit 0 by itself, no fault line.
head, D3D12, first RX_D3D12=1 fail the back end started on Intel(R) Arc(TM) Graphics, then the host crashed 16 s later in the title, before the menu (section 5).
head, D3D12, second RX_D3D12=1, same build ok save at 96 s, Kokiri, Market, four pictures, 1,903 presents, fps median 8.8 (6.8 to 10.9), exit 0, no fault line.
head, D3D12, package DLL head game build plus the package's longshot_d3d12.dll ok save at 87 s, Kokiri, Market, four pictures, 1,894 presents, fps median 11.6 (6.8 to 12.8), exit 0, no fault line.
head, native mesh RX_D3D12=1 RX_D3D12_MESH_NATIVE=1 RX_D3D12_MARKERS=2, 300 s cap, last fail: device removed the hang described in section 4. The game exited 0 by itself and Windows recovered.
head, debug layer RX_D3D12_DEBUG=1 not run Graphics Tools is not installed.
head, package DLL, first attempt void the cloned run folder had copied a pending crash report from the crashed run; the game stopped on its crash window and was killed at the cap. This is a harness mistake, not evidence about either DLL.

Reading the table: three D3D12 runs on the head build were valid, one crashed and two played. Two D3D12 runs (base and head) reached the Market. The two Vulkan runs did not reach the Market within the script's wait, because the first Vulkan start on a machine with empty caches translates shaders in play and the laptop's Arc GPU does not finish a fresh shader preparation in any reasonable time (an older run of ours reached 399 of 38,809 programs in 392 s). So there is no Vulkan-against-D3D12 comparison at the Market, and the Kokiri comparison is picture-only.


4. The native-mesh hang

With RX_D3D12_MESH_NATIVE=1:

  • The game reached the menu normally and then, at the first native mesh draws, the log reported IDXGISwapChain::Present failed (0x887a0005): the device was removed (0x887a0006).
  • DRED reported the device hung, and no page-fault address.
  • Replay list 0 stopped at operation 668 of its 933 operations, after marker 25 of 29, which the fork's own marker line names as native mesh: program 4059, indirect 0. Markers 26 to 28 (programs 4053, 4087, 4082) belong to the same pass: draws to a 960x540 R11G11B10F colour target with a 960x540 D32F depth target. The dispatch before it was program 12744.
  • The fork's notes on the B580 say the replay stopped at 670 of 933. 668 against 670, on a different GPU with the same driver version, strongly suggests the same operation, so the hang is not specific to the B580.
  • Also logged in that run: several stages of programs 0x1b0b to 0x1b0f "do not lower": the translator says they need a native matrix multiply and tells you to set EDEN_NX2_TENSOR to emulate. That is the upscaler's cooperative-matrix shaders, unrelated to the mesh path, but it appears with native mesh on.
  • Windows recovered (a driver reset), the game exited by itself with code 0, and the laptop was free afterwards with no game or task left running.

What this does and does not say: it says the first native mesh draw in this scene hangs two different Arc GPUs at the same replay position. It does not say why. The fork's docs/d3d12.md section 11 already lists the translator-side suspicions (variable pointers, OpAccessChain with an undefined operand, warp operations in divergent control flow). We have nothing to add on cause. A debug-layer or GPU-based-validation run of exactly that draw would be the next useful step, and it needs Graphics Tools on the machine.


5. The crash at the title (first head run)

  • The back end started (d3d12: started on Intel(R) Arc(TM) Graphics, version line v3.0.0-rc.7-34-gf0f9a048e), and 16 seconds later, in the title and before the menu, the host crashed with exception 0xc0000005 (an access violation, a read of a guest address) on a worker thread, with the title movie's video decoder thread waiting for a core at the time.
  • The faulting module was the game's own exe, not longshot_d3d12.dll: the call came from ntdll, called from the exe. A second, different exception (0x87a) was raised inside dxgi.dll under the D3D12 DLL during the quit that followed, which is probably fallout from the crash rather than the cause.
  • It did not repeat: the next two head runs on the same build (one of them with the package's DLL) passed, and neither Vulkan run crashed. One crash in three valid D3D12 head runs, and none on the base build in one run, is not enough to say whether it is the D3D12 path, a race in the host, or the cold start.
  • We still have the crash report and can send it.

6. What the pictures show

The control bridge's pictures were used (1280x720). Our usual window capture failed in every run ("expected exactly one visible owned game window; found 0"), so there is no picture of the window itself, and the Insert-menu overlay does not appear (the D3D12 table has no overlay, settings rows or upscaler yet).

  • Kokiri Forest, base and head under D3D12: lit, textured and close to the Vulkan picture of the same spot, with one clear defect, the same in both runs: a black jagged shape at the left of the frame (about x 130 to 250, y 210 to 350) where the Vulkan picture draws foliage. We did not diagnose it; it is a picture, not a finding about cause.
  • Market, early picture under D3D12 (base): the gate view with large white holes where buildings and a guard should be. This matches the fork's own description in its section 3.6: draws are left out while their pipelines are being made on the worker threads.
  • Market, later picture with the package's DLL (head): complete: houses, banners, the guard, the castle, Navi.
  • Vulkan runs: a complete Kokiri; no Market picture because of the load timeout.

7. The Mesa DLL and the test package

  • The fork's third_party/mesa-spirv-to-dxil/PROVENANCE.md names the asset (spirv_to_dxil.dll of mesa-dist-win mesa3d-26.2.6-release-msvc.7z) but gives neither a URL nor a hash. We fetched the asset (tag 26.2.6) through the release API. The file's SHA-256 equals the release asset's own digest field, and the release ships no separate checksum file. Only that DLL was extracted; the archive and scratch files were deleted.
  • The spirv_to_dxil.dll in the test package the fork's author supplied is byte-identical to the one we fetched (10,407,936 bytes, SHA-256 beginning 8c6e6f8e). So the package corroborates the hash we recorded on first use. If the fork wants a pinned hash, that is the one we saw.
  • DXC (needed only for native mesh) is pinned by the fork with URL and hash, and our download matched the hash.
  • The package's longshot_d3d12.dll (7,181,824 bytes, SHA-256 beginning 9d91ab0c) against our cross-build of f0f9a048e (SHA-256 beginning 2478cd87): same size, same single export (mkwvk_init), same 16 imports, same section sizes and entry point. In .text, 22,519 of 3,782,582 bytes differ (0.6%), which is what a different tree path, a different timestamp and 96 more bytes of .rdata shifting the addresses would produce. Same code, not bit-identical.
  • The run with the package's DLL on our head game build played to the Market and had the highest frame rate of the three D3D12 runs (median 11.6 against 8.8 and 7.8). We do not read that as the DLLs differing: all three runs are single cold runs on a machine with other state, and the ranges overlap (6.8 up to 10.8, 10.9 and 12.8).

8. Frame rates: what they are and are not

D3D12 medians: 7.8 (base), 8.8 (head), 11.6 (head, package DLL); Vulkan medians: 11.8 (head), 13.7 (base). They are the host's own present counters, one run each, on a cold shader cache, on a shared-memory iGPU, with the machine's other processes uncontrolled. They are not measurements, not a comparison of the two renderers, and not a comparison of the two commits. What they do say: the D3D12 renderer is playable-slowly on this iGPU and not obviously several times slower than Vulkan on the same machine, which is as much as one cold run can show. The fork's own notes give frame rates for a discrete B580; that is a different machine.


9. Game-free results on Linux

All runs strict, six at a time, in separate worktrees of the base, the head and current main (876dc3609).

tree checks passed failed skipped
forge main 780 722 41 17
base 5e7d84ab2 734 677 40 17
head f0f9a048e 734 675 42 17
  • All 13 tests/test_d3d12_*.py pass at the base and at the head (astc_gpu, back_diff, bounce_homes, cbufs, copy_split, live_bounce, lookups, pool_open_race, program_cache, resume_collects, snorm_attributes, vertex_copy, workers).
  • New with the two commits, pass at base and fail at head: nx2/test_draw_parameters.py and tests/test_mesh_unreachable_outputs.py. Both are text-cutting fixtures of Eden's SPIR-V emitter: the head's emitter now uses ctx.profile.hlsl_mesh, ctx.cf_depth and ctx.cf_early_exit, which the fixtures' stand-in context does not have (error: no member named 'profile' in 'Ctx', no member named 'cf_early_exit'). The fork's commit message says the same 47 tests fail before and after on the author's PC; on this PC these two pass before and fail after. They test the Vulkan back end's emitter, which the commits change behind hlsl_mesh and cf_depth guards, so the fix is probably to extend the fixtures' stand-in, and a Vulkan run of the head is still wanted (the commit message says it was not checked).
  • 40 names fail at both the base and the head: 32 of them also fail on current main (this PC's inherited set), and 8 fail on the branch but pass on main because the branch is 82 commits behind (test_framegen_preset, test_import_reach, test_rumble_menu, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_vcore_escape, test_vk_swapchain_compat).
  • Windows-target syntax check of the changed fixtures (syntax only; Windows execution not tested): test_d3d12_pool_open_race.py passes; test_d3d12_program_cache.py fails because its generated C++ lacks _CRT_SECURE_NO_WARNINGS under -Werror (fopen and memcpy are deprecated), and it fails identically at the base, so it is inherited, not caused by these two commits.
  • Third-party additions: third_party/spirv-cross (Apache-2.0, with LICENSE, LICENSES/* and a PROVENANCE with upstream URL, SHA-256 and tree SHA-256), third_party/dxc-api (the header, three licence texts, PROVENANCE with URL and hash), and earlier in the branch third_party/directx-headers (MIT) and third_party/mesa-spirv-to-dxil (two headers; the PROVENANCE names the DLL asset but has no URL and no hash, see section 7). The repository's own check says "17 parts as their notes say".

10. Distance from main

  • Base 5e7d84ab2 is 32 commits ahead and 82 behind main; head f0f9a048e is 34 ahead and 82 behind. The merge base is 544229a26 (17 November 03:50 UTC). The compare is 59 changed files by git diff (+54,615 / -110), three fewer than the 62 quoted for it.
  • Neither commit merges into current main. Both conflict in gpu/vk/switches.def and tests/test_switch_table.py.
  • MKWVK_API_VERSION is 29 on the branch and 33 on main, and mkwvk_init returns null for any other version. The shared interface gained four versions since the branch forked (vk_api.h changed by +31/-3 lines), so a rebase has to teach the D3D12 renderer table the four versions of the seam, not just resolve two files.
  • gpu/d3d12/ does not exist on main at all: the work is 34 commits wholly outside main. The translator inputs (nx2/) are untouched by the whole branch (two fresh Windows lifts gave equal lift keys for base and head).
  • What the change needed in the shared Vulkan code (whole branch against the merge base): 11 files and +421/-45 lines, all in Eden's shader recompiler and sirit, none in a vk_*.cpp: a new profile flag (hlsl_mesh), a new mesh_output_remap in the runtime info, a warp-in-workgroup emission (+153 lines in emit_spirv_warp.cpp), +174 lines in the emit context, control-flow-depth tracking in emit_spirv.cpp, and OpIAddCarry output in emit_spirv_integer.cpp, plus about 60 new switch rows. The D3D12 DLL fills 27 of the interface table's 36 renderer members and leaves 9 null (option, option_set, setting, setting_set, jitter_sample, nvn_program_created, nvn_pool_created, nvn_vmap_changing, nvn_texture_created), which the host tolerates: no overlay, settings or upscaler yet. That is the main reason the second back end fit behind the seam without touching the Vulkan renderer files.

11. Suggested next steps, in order

  1. Rebase onto current main and extend the D3D12 table to the current interface version (33 today). Until then none of our tooling or the farm can build it from main.
  2. Fix the two emitter fixtures (nx2/test_draw_parameters.py, tests/test_mesh_unreachable_outputs.py) so the Vulkan-side checks pass again, and run the head's Vulkan back end in the game at least once on a GPU where it is known good (the commit message says it was not checked).
  3. Get the native-mesh hang on a machine with the debug layer (Graphics Tools installed), with RX_D3D12_DEBUG=3 limited to the one frame, around program 4059 and the draws after it in the 960x540 R11G11B10F pass. Two GPUs now stop at the same replay operation, so a debug-layer message is likely to be the same on both.
  4. Look at the black jagged shape in Kokiri (left of the frame, foliage in Vulkan): same position in two runs, a good candidate for a draw that is dropped or a texture that is read in the wrong layout (the fork's own section 11 already lists textures sampled in the RENDER_TARGET layout, error 1358).
  5. Pin the Mesa DLL: put the asset's URL and the SHA-256 (8c6e6f8e..., 10,407,936 bytes, from mesa-dist-win release 26.2.6) in third_party/mesa-spirv-to-dxil/PROVENANCE.md.
  6. The one title crash: if it recurs, the report we kept has the faulting module and thread; a debug run of the title movie's decoder thread beside the D3D12 start is the first thing to try.

12. Limits of this test

  • One integrated GPU, one driver, one OS build, one save, one route, single runs, cold caches. The frame rates are not measurements.
  • No Vulkan-against-D3D12 comparison at the Market (the Vulkan runs timed out on a cold cache).
  • No window picture, no overlay, no debug layer.
  • The head's Vulkan back end was run on the laptop twice (partial runs) but not on a discrete GPU.
  • Anything on Linux: the back end is a Windows DLL (a Wine and vkd3d-proton route was not tried, and would not tell anything about Intel's own D3D12 driver).
  • We did not test the package's rename-to-longshot_vk.dll route (it needs a launcher-installed rc.7 exe).

13. What we can share

The run folders (log, present trace, bridge pictures, a judge file per run), the crash report, the build receipts with all hashes and the whole-suite comparison are kept by us. Ask and we will attach them.


New on this forge; not opened on GitHub.

**Type:** feature · **Area:** renderer, Windows · **Part of:** #1493 ## TL;DR nyannoying's fork has a Direct3D 12 back end that sits behind the same renderer seam as the Vulkan one. We ran its base and head commits on a Windows laptop with an Intel Arc integrated GPU, and built and tested them on Linux. It plays: the title, a save, Kokiri Forest and the Market, in three of four valid D3D12 runs, with one crash at the title that did not repeat. Its native-mesh path hangs the GPU at the same replay operation (668 of 933) as on the author's B580. Neither commit merges into main today. No speed claim is made: these are single cold runs. ## Breakdown - **What this is:** a record of the first outside test of the fork's D3D12 back end (commits `5e7d84ab2` and `f0f9a048e`, the compare https://git.magicbean.dev/nyannoying/Longshot/compare/5e7d84ab2f748eb88cb5b87b3ed79cd99ccaadfe...f0f9a048e60bd25952cb0a2608dbcd6c18e88b3b), kept in one place so the work can be found, discussed and reproduced. - **What was run:** the project's strict whole suite and the fork's own D3D12 tests on Linux; Windows cross-builds of both commits; eight scripted runs on one laptop (Core Ultra 9 185H, Arc iGPU, driver 32.0.101.9175, Windows 11 10.0.26300). - **What works:** D3D12 reached the menu, loaded a save, played Kokiri Forest and reached the Market on both commits. All 13 `tests/test_d3d12_*.py` pass at both. - **What does not:** the native-mesh path (device removed, the same replay position as on the B580); one host crash at the title in the first head run; one black jagged shape in Kokiri that Vulkan draws as foliage; two Vulkan-side fixtures fail at the head. - **What is unknown:** the cause of the hang and of the crash, any speed comparison with Vulkan (the Vulkan runs timed out at the Market on a cold cache), the debug layer (Graphics Tools is not installed on the laptop). - **What it would take to reach main:** a rebase over 82 commits and the interface version (`MKWVK_API_VERSION` 29 on the branch, 33 on main; the DLL refuses any other), plus the two fixtures. - **What we ask:** whether the author wants these results as a base for his own issue or pull request, and which of the next steps below he wants help with. ## 2. What was tested and how ### 2.1 Scope We queued the two commits of the compare in our test harness: 1. **Game-free checks on Linux**: the project's whole test suite (strict) at the base, the head and current main, plus the fork's own `tests/test_d3d12_*.py`, plus a Windows-target syntax check of the changed fixtures, plus the third-party provenance check. 2. **Windows cross-builds** of both commits (llvm-mingw 20261104, Clang 23.1.5, on a Linux PC): the game, the Vulkan DLL and the D3D12 DLL, with no warnings. 3. **Real runs on one Windows laptop**, one game at a time, with an idle probe and AC power checked before every run. ### 2.2 The laptop - Intel Core Ultra 9 185H, integrated **Intel Arc Graphics** (Meteor Lake iGPU, shared memory, no dedicated VRAM). - Graphics driver **32.0.101.9175**, the same driver version the fork's notes use for the B580. - Windows 11 Pro 10.0.26300, AC power online. - The back end's own startup line reported: `shader model 6.8, binding tier 3, waves of 8 to 32 lanes, mesh shader tier 10, enhanced barriers yes, relaxed format casting yes`, and a video-memory budget of 47,889 MB (that is the shared system memory, not a dedicated pool). - The Graphics Tools optional Windows feature is **not installed**, so the D3D12 debug layer and GPU-based validation could not be used. We did not install it. ### 2.3 The builds - The game is our own cross-build of each commit: `v3.0.0-rc.7-32-g5e7d84ab2` (base) and `v3.0.0-rc.7-34-gf0f9a048e` (head), both reporting renderer interface version 29 on both sides, so the version check refused nothing. Both builds linked without warnings. The shader translator inputs are identical between the two commits (the lift is the same), so only the renderer DLLs and the Eden recompiler files differ. - The D3D12 DLL was built with the branch's own `gpu/d3d12/build.py` (the `dev_build.py d3d12` entry stops on a Linux host with "Windows only", so the Linux-hosted llvm-mingw route was used). Both DLLs export `mkwvk_init`, import only the kernel, user and UCRT libraries plus `d3d12.dll` and `dxgi.dll`, and built with zero warnings. - Run-time files beside the game: Mesa's `spirv_to_dxil.dll` (the one in the test package, see section 7) for every D3D12 run, and DXC (`dxcompiler.dll` and `dxil.dll`, pinned by the fork with URL and hash, v1.9.2609) only for the native-mesh run. - The D3D12 renderer was switched on with `RX_D3D12=1` and `longshot_d3d12.dll` beside the exe, as `docs/d3d12.md` section 10.1 describes. The test package's README describes a different route (rename the DLL to `longshot_vk.dll` in a launcher-installed rc.7); we did not run that route because it targets the released exe, which has no such switch. ### 2.4 The run procedure Every run used the same scripted session through the game's control bridge, so the arms are comparable in what they did even though one run each is not a statistical sample: 1. Start with a cold shader/program cache (the folders were new; neither Vulkan nor D3D12 caches existed). 2. Wait for the title menu, take a picture, press A four times. 3. Wait for fresh play in Kokiri Forest (limit 240 s), settle 20 s, take a picture, hold 45 s, take a picture. 4. If the game's clock is under 260 s, teleport to the Market, settle 20 s, take a picture, hold 25 s. 5. Quit once. Present counts and the host's frame rate are sampled every 2.5 seconds. 6. A fault line in the game's log (`d3d12: device lost`, a failed D3D12 call, "back end did not start", FATAL, CRASH) ends the observation. The caps were 450 s per run and 300 s for the native-mesh run, with that run last on purpose. --- ## 3. Results | Run | What | Verdict | What happened | |---|---|---|---| | head, Vulkan | `f0f9a048e`, default renderer | partial | menu at 36 s, save and Kokiri at 66 s, pictures taken; the Market teleport stayed "loading" for 90 s on cold Vulkan caches until the script's wait expired. 754 presents, host fps median 11.8 (9.8 to 12.7). No fault line, exit 0. | | base, Vulkan | `5e7d84ab2`, default renderer | partial | same as above; save at 53 s, Market load timeout; fps median 13.7 (11.7 to 14.8). | | base, D3D12 | `RX_D3D12=1` | **ok** | menu at 29 s, save loaded at 134 s, Kokiri, then the Market reached, four pictures, 1,873 presents, fps median 7.8 (6.8 to 10.8), exit 0 by itself, no fault line. | | head, D3D12, first | `RX_D3D12=1` | **fail** | the back end started on `Intel(R) Arc(TM) Graphics`, then the host crashed 16 s later in the title, before the menu (section 5). | | head, D3D12, second | `RX_D3D12=1`, same build | **ok** | save at 96 s, Kokiri, Market, four pictures, 1,903 presents, fps median 8.8 (6.8 to 10.9), exit 0, no fault line. | | head, D3D12, package DLL | head game build plus the package's `longshot_d3d12.dll` | **ok** | save at 87 s, Kokiri, Market, four pictures, 1,894 presents, fps median 11.6 (6.8 to 12.8), exit 0, no fault line. | | head, native mesh | `RX_D3D12=1 RX_D3D12_MESH_NATIVE=1 RX_D3D12_MARKERS=2`, 300 s cap, last | **fail: device removed** | the hang described in section 4. The game exited 0 by itself and Windows recovered. | | head, debug layer | `RX_D3D12_DEBUG=1` | not run | Graphics Tools is not installed. | | head, package DLL, first attempt | | void | the cloned run folder had copied a pending crash report from the crashed run; the game stopped on its crash window and was killed at the cap. This is a harness mistake, not evidence about either DLL. | Reading the table: three D3D12 runs on the head build were valid, one crashed and two played. Two D3D12 runs (base and head) reached the Market. The two Vulkan runs did not reach the Market within the script's wait, because the first Vulkan start on a machine with empty caches translates shaders in play and the laptop's Arc GPU does not finish a fresh shader preparation in any reasonable time (an older run of ours reached 399 of 38,809 programs in 392 s). So **there is no Vulkan-against-D3D12 comparison at the Market**, and the Kokiri comparison is picture-only. --- ## 4. The native-mesh hang With `RX_D3D12_MESH_NATIVE=1`: - The game reached the menu normally and then, at the first native mesh draws, the log reported `IDXGISwapChain::Present failed (0x887a0005)`: the device was removed (`0x887a0006`). - DRED reported **the device hung**, and no page-fault address. - **Replay list 0 stopped at operation 668 of its 933 operations**, after marker 25 of 29, which the fork's own marker line names as `native mesh: program 4059, indirect 0`. Markers 26 to 28 (programs 4053, 4087, 4082) belong to the same pass: draws to a 960x540 R11G11B10F colour target with a 960x540 D32F depth target. The dispatch before it was program 12744. - The fork's notes on the B580 say the replay stopped at 670 of 933. **668 against 670, on a different GPU with the same driver version**, strongly suggests the same operation, so the hang is not specific to the B580. - Also logged in that run: several stages of programs 0x1b0b to 0x1b0f "do not lower": the translator says they need a native matrix multiply and tells you to set `EDEN_NX2_TENSOR` to emulate. That is the upscaler's cooperative-matrix shaders, unrelated to the mesh path, but it appears with native mesh on. - Windows recovered (a driver reset), the game exited by itself with code 0, and the laptop was free afterwards with no game or task left running. What this does and does not say: it says the first native mesh draw in this scene hangs two different Arc GPUs at the same replay position. It does not say why. The fork's `docs/d3d12.md` section 11 already lists the translator-side suspicions (variable pointers, `OpAccessChain` with an undefined operand, warp operations in divergent control flow). We have nothing to add on cause. A debug-layer or GPU-based-validation run of exactly that draw would be the next useful step, and it needs Graphics Tools on the machine. --- ## 5. The crash at the title (first head run) - The back end started (`d3d12: started on Intel(R) Arc(TM) Graphics`, version line `v3.0.0-rc.7-34-gf0f9a048e`), and **16 seconds later, in the title and before the menu, the host crashed** with exception `0xc0000005` (an access violation, a read of a guest address) on a worker thread, with the title movie's video decoder thread waiting for a core at the time. - The faulting module was **the game's own exe, not `longshot_d3d12.dll`**: the call came from ntdll, called from the exe. A second, different exception (`0x87a`) was raised inside `dxgi.dll` under the D3D12 DLL during the quit that followed, which is probably fallout from the crash rather than the cause. - It **did not repeat**: the next two head runs on the same build (one of them with the package's DLL) passed, and neither Vulkan run crashed. One crash in three valid D3D12 head runs, and none on the base build in one run, is not enough to say whether it is the D3D12 path, a race in the host, or the cold start. - We still have the crash report and can send it. --- ## 6. What the pictures show The control bridge's pictures were used (1280x720). Our usual window capture failed in every run ("expected exactly one visible owned game window; found 0"), so there is **no picture of the window itself**, and the Insert-menu overlay does not appear (the D3D12 table has no overlay, settings rows or upscaler yet). - **Kokiri Forest, base and head under D3D12:** lit, textured and close to the Vulkan picture of the same spot, with **one clear defect, the same in both runs**: a black jagged shape at the left of the frame (about x 130 to 250, y 210 to 350) where the Vulkan picture draws foliage. We did not diagnose it; it is a picture, not a finding about cause. - **Market, early picture under D3D12 (base):** the gate view with large white holes where buildings and a guard should be. This matches the fork's own description in its section 3.6: draws are left out while their pipelines are being made on the worker threads. - **Market, later picture with the package's DLL (head):** complete: houses, banners, the guard, the castle, Navi. - **Vulkan runs:** a complete Kokiri; no Market picture because of the load timeout. --- ## 7. The Mesa DLL and the test package - The fork's `third_party/mesa-spirv-to-dxil/PROVENANCE.md` names the asset (`spirv_to_dxil.dll` of mesa-dist-win `mesa3d-26.2.6-release-msvc.7z`) but gives **neither a URL nor a hash**. We fetched the asset (tag 26.2.6) through the release API. The file's SHA-256 equals the release asset's own `digest` field, and the release ships no separate checksum file. Only that DLL was extracted; the archive and scratch files were deleted. - **The `spirv_to_dxil.dll` in the test package the fork's author supplied is byte-identical to the one we fetched** (10,407,936 bytes, SHA-256 beginning `8c6e6f8e`). So the package corroborates the hash we recorded on first use. If the fork wants a pinned hash, that is the one we saw. - DXC (needed only for native mesh) is pinned by the fork with URL and hash, and our download matched the hash. - **The package's `longshot_d3d12.dll`** (7,181,824 bytes, SHA-256 beginning `9d91ab0c`) against our cross-build of `f0f9a048e` (SHA-256 beginning `2478cd87`): same size, same single export (`mkwvk_init`), same 16 imports, same section sizes and entry point. In `.text`, 22,519 of 3,782,582 bytes differ (0.6%), which is what a different tree path, a different timestamp and 96 more bytes of `.rdata` shifting the addresses would produce. **Same code, not bit-identical.** - The run with the package's DLL on our head game build played to the Market and had the highest frame rate of the three D3D12 runs (median 11.6 against 8.8 and 7.8). We do not read that as the DLLs differing: all three runs are single cold runs on a machine with other state, and the ranges overlap (6.8 up to 10.8, 10.9 and 12.8). --- ## 8. Frame rates: what they are and are not D3D12 medians: 7.8 (base), 8.8 (head), 11.6 (head, package DLL); Vulkan medians: 11.8 (head), 13.7 (base). They are the host's own present counters, **one run each, on a cold shader cache, on a shared-memory iGPU, with the machine's other processes uncontrolled**. They are not measurements, not a comparison of the two renderers, and not a comparison of the two commits. What they do say: the D3D12 renderer is playable-slowly on this iGPU and not obviously several times slower than Vulkan on the same machine, which is as much as one cold run can show. The fork's own notes give frame rates for a discrete B580; that is a different machine. --- ## 9. Game-free results on Linux All runs strict, six at a time, in separate worktrees of the base, the head and current main (`876dc3609`). | tree | checks | passed | failed | skipped | |---|---|---|---|---| | forge main | 780 | 722 | 41 | 17 | | base `5e7d84ab2` | 734 | 677 | 40 | 17 | | head `f0f9a048e` | 734 | 675 | 42 | 17 | - **All 13 `tests/test_d3d12_*.py` pass at the base and at the head** (astc_gpu, back_diff, bounce_homes, cbufs, copy_split, live_bounce, lookups, pool_open_race, program_cache, resume_collects, snorm_attributes, vertex_copy, workers). - **New with the two commits, pass at base and fail at head:** `nx2/test_draw_parameters.py` and `tests/test_mesh_unreachable_outputs.py`. Both are text-cutting fixtures of Eden's SPIR-V emitter: the head's emitter now uses `ctx.profile.hlsl_mesh`, `ctx.cf_depth` and `ctx.cf_early_exit`, which the fixtures' stand-in context does not have (`error: no member named 'profile' in 'Ctx'`, `no member named 'cf_early_exit'`). The fork's commit message says the same 47 tests fail before and after on the author's PC; on this PC these two pass before and fail after. They test the Vulkan back end's emitter, which the commits change behind `hlsl_mesh` and `cf_depth` guards, so the fix is probably to extend the fixtures' stand-in, and a Vulkan run of the head is still wanted (the commit message says it was not checked). - 40 names fail at both the base and the head: 32 of them also fail on current main (this PC's inherited set), and 8 fail on the branch but pass on main because the branch is 82 commits behind (`test_framegen_preset`, `test_import_reach`, `test_rumble_menu`, `test_target_image_pool`, `test_tested_configurations`, `test_upscaler_round_trip`, `test_vcore_escape`, `test_vk_swapchain_compat`). - **Windows-target syntax check** of the changed fixtures (syntax only; Windows execution not tested): `test_d3d12_pool_open_race.py` passes; `test_d3d12_program_cache.py` fails because its generated C++ lacks `_CRT_SECURE_NO_WARNINGS` under `-Werror` (`fopen` and `memcpy` are deprecated), and it fails identically at the base, so it is inherited, not caused by these two commits. - **Third-party additions:** `third_party/spirv-cross` (Apache-2.0, with `LICENSE`, `LICENSES/*` and a PROVENANCE with upstream URL, SHA-256 and tree SHA-256), `third_party/dxc-api` (the header, three licence texts, PROVENANCE with URL and hash), and earlier in the branch `third_party/directx-headers` (MIT) and `third_party/mesa-spirv-to-dxil` (two headers; the PROVENANCE names the DLL asset but has no URL and no hash, see section 7). The repository's own check says "17 parts as their notes say". --- ## 10. Distance from main - Base `5e7d84ab2` is 32 commits ahead and 82 behind main; head `f0f9a048e` is 34 ahead and 82 behind. The merge base is `544229a26` (17 November 03:50 UTC). The compare is 59 changed files by `git diff` (+54,615 / -110), three fewer than the 62 quoted for it. - **Neither commit merges into current main.** Both conflict in `gpu/vk/switches.def` and `tests/test_switch_table.py`. - **`MKWVK_API_VERSION` is 29 on the branch and 33 on main**, and `mkwvk_init` returns null for any other version. The shared interface gained four versions since the branch forked (`vk_api.h` changed by +31/-3 lines), so a rebase has to teach the D3D12 renderer table the four versions of the seam, not just resolve two files. - `gpu/d3d12/` does not exist on main at all: the work is 34 commits wholly outside main. The translator inputs (`nx2/`) are untouched by the whole branch (two fresh Windows lifts gave equal lift keys for base and head). - **What the change needed in the shared Vulkan code** (whole branch against the merge base): 11 files and +421/-45 lines, all in Eden's shader recompiler and sirit, none in a `vk_*.cpp`: a new profile flag (`hlsl_mesh`), a new `mesh_output_remap` in the runtime info, a warp-in-workgroup emission (+153 lines in `emit_spirv_warp.cpp`), +174 lines in the emit context, control-flow-depth tracking in `emit_spirv.cpp`, and `OpIAddCarry` output in `emit_spirv_integer.cpp`, plus about 60 new switch rows. The D3D12 DLL fills 27 of the interface table's 36 renderer members and leaves 9 null (`option`, `option_set`, `setting`, `setting_set`, `jitter_sample`, `nvn_program_created`, `nvn_pool_created`, `nvn_vmap_changing`, `nvn_texture_created`), which the host tolerates: no overlay, settings or upscaler yet. That is the main reason the second back end fit behind the seam without touching the Vulkan renderer files. --- ## 11. Suggested next steps, in order 1. **Rebase onto current main** and extend the D3D12 table to the current interface version (33 today). Until then none of our tooling or the farm can build it from main. 2. **Fix the two emitter fixtures** (`nx2/test_draw_parameters.py`, `tests/test_mesh_unreachable_outputs.py`) so the Vulkan-side checks pass again, and run the head's Vulkan back end in the game at least once on a GPU where it is known good (the commit message says it was not checked). 3. **Get the native-mesh hang on a machine with the debug layer** (Graphics Tools installed), with `RX_D3D12_DEBUG=3` limited to the one frame, around program 4059 and the draws after it in the 960x540 R11G11B10F pass. Two GPUs now stop at the same replay operation, so a debug-layer message is likely to be the same on both. 4. **Look at the black jagged shape in Kokiri** (left of the frame, foliage in Vulkan): same position in two runs, a good candidate for a draw that is dropped or a texture that is read in the wrong layout (the fork's own section 11 already lists textures sampled in the RENDER_TARGET layout, error 1358). 5. **Pin the Mesa DLL**: put the asset's URL and the SHA-256 (`8c6e6f8e...`, 10,407,936 bytes, from mesa-dist-win release 26.2.6) in `third_party/mesa-spirv-to-dxil/PROVENANCE.md`. 6. **The one title crash**: if it recurs, the report we kept has the faulting module and thread; a debug run of the title movie's decoder thread beside the D3D12 start is the first thing to try. --- ## 12. Limits of this test - One integrated GPU, one driver, one OS build, one save, one route, single runs, cold caches. The frame rates are not measurements. - No Vulkan-against-D3D12 comparison at the Market (the Vulkan runs timed out on a cold cache). - No window picture, no overlay, no debug layer. - The head's Vulkan back end was run on the laptop twice (partial runs) but not on a discrete GPU. - Anything on Linux: the back end is a Windows DLL (a Wine and vkd3d-proton route was not tried, and would not tell anything about Intel's own D3D12 driver). - We did not test the package's rename-to-`longshot_vk.dll` route (it needs a launcher-installed rc.7 exe). ## 13. What we can share The run folders (log, present trace, bridge pictures, a judge file per run), the crash report, the build receipts with all hashes and the whole-suite comparison are kept by us. Ask and we will attach them. --- New on this forge; not opened on GitHub.
Collaborator

Possibly related, for context:

  • issue #1493 Renderer rewrite — Renderer-backend work builds on this renderer-rewrite discussion
  • issue #606 Game: Arc B390 (Panther Lake iGPU, Windows): the GPU is lost a few minutes into play, twice at a dispatch of compute program 499dbfd0721d2858 — Related Intel iGPU device-loss testing, but Vulkan and different GPU work
  • issue #583 RX 6600 (Navi 23, Windows): device lost in Dodongo's Cavern with native mesh shaders, compute fixes it — Related native-mesh device-loss symptom on Vulkan, not the D3D12 backend
Possibly related, for context: - issue #1493 Renderer rewrite — Renderer-backend work builds on this renderer-rewrite discussion - issue #606 Game: Arc B390 (Panther Lake iGPU, Windows): the GPU is lost a few minutes into play, twice at a dispatch of compute program 499dbfd0721d2858 — Related Intel iGPU device-loss testing, but Vulkan and different GPU work - issue #583 RX 6600 (Navi 23, Windows): device lost in Dodongo's Cavern with native mesh shaders, compute fixes it — Related native-mesh device-loss symptom on Vulkan, not the D3D12 backend
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#1619
No description provided.