Skip to content

runtime, tools: select the LOD-bias fallback on KosmicKrisp too (TEST-918) - #4641

Closed
wavehs wants to merge 2 commits into
ProjectLeonida:mainfrom
wavehs:test-918-kosmickrisp-lod-bias
Closed

wavehs wants to merge 2 commits into
ProjectLeonida:mainfrom
wavehs:test-918-kosmickrisp-lod-bias

Conversation

@wavehs

@wavehs wavehs commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-918.

Depends on #1845 (SHADER-268, the shader-side LOD bias fallback itself). The PR diff therefore shows #1845's commit too: the change to review here is the last commit, 8e55d5d3 (git show 8e55d5d3).

What and why

KosmicKrisp, Mesa's Metal driver (driver ID 28), reports VkPhysicalDevicePortabilitySubsetFeaturesKHR::samplerMipLodBias as true, but its OpImageQueryLod leaves the sampler's mipLodBias out of the calculated LOD and adds it, unrounded and past the last level, to the clamped one (#3124, Mesa 26.3.1, M3 Max). So ps_ssharp_lod fails natively there while the probe says the samplers take a bias.

#1845 selects --lod-bias-fallback from that portability-subset feature, so on KosmicKrisp it selects nothing, and its own known-problems row says to force LEONIDA_LOD_BIAS_FALLBACK=1 by hand. This PR closes that: the fallback is selected for KosmicKrisp by driver ID.

Changes (commit 8e55d5d3)

  • tools/vk_subgroup_info.py: sampler_lod_bias is false for driver ID 28 whatever the feature says, and the answer carries kosmickrisp.
  • runtime/src/vulkan_portability.h: sampler_mip_lod_bias() is false for driver ID 28 (is_kosmickrisp, by the driver ID like is_moltenvk, since the extension may not be in sight), so vulkan_sampler() creates samplers with mipLodBias 0 and the shaders translated with --lod-bias-fallback apply the S#'s bias there, as on MoltenVK. Older Vulkan headers get the driver ID constant.
  • docs/design.md: how sampler_lod_bias is chosen. docs/testing.md: the ps_ssharp_lod row says the tooling selects the fallback for KosmicKrisp.
  • tests/test_vk_subgroup_info.py: a KosmicKrisp device that reports the feature (with and without VK_KHR_portability_subset), MoltenVK, and an AMD device that keeps the bias.

Gone from the earlier version of this PR, on review: the runtime branch that claimed shaders handle the bias while nothing did, and the sampler_lod_bias flag inferred from a driver blacklist — the field and its MoltenVK meaning are #1845's, and it is only overridden for the one driver that measurably drops the bias.

Testing

macOS 27.2.1, Apple M3 Pro, CPython 3.15.2. No game files.

  • python -I tests/test_vk_subgroup_info.py -> 46 tests OK.
  • tools/vk_subgroup_info.py against the real drivers on this machine: KosmicKrisp (Homebrew Mesa, driver 28) -> "kosmickrisp": true, "sampler_lod_bias": false; MoltenVK (driver 14) -> "sampler_lod_bias": false. Before this change the same KosmicKrisp device answered true, which is the bug.
  • tests/test_docs_design_rows.py, test_docs_links.py, test_docs_repo_paths.py, test_make_game_translator_flags.py, test_shader_checks.py -> OK; python -m compileall -q tools tests -> OK.
  • cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo; cmake --build runtime/build -> 96/96 targets, clean.

ps_ssharp_lod passing with the fallback on KosmicKrisp is #3124's and #1845's measurement (M3 Max, Mesa 26.3.1); this change makes that selection automatic and was not re-run on a GPU here.

AI-assisted.

Checklist

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

@tupacfan04

Copy link
Copy Markdown
Contributor

Request changes: the documented shader-side LOD-bias fallback does not exist, so this cannot fix ps_ssharp_lod.

Verified: tests/test_vk_subgroup_info.py 49 OK, docs tests 20, compileall clean, and the negative control is red on main's tool (11 failures + 1 error). Driver id 28 is correct (VK_DRIVER_ID_MESA_KOSMICKRISP).

But there is no LOD_BIAS handling in tools/rdna2spirv.py on main, and docs/design.md:357 says raw LOD comes from the driver sampler. With max_sampler_lod_bias = 0 (d3d12_vulkan_device.cpp:4176), mipLodBias becomes clamp(bias, 0, 0) = 0, so a non-zero sampler bias is silently dropped on KosmicKrisp and nothing applies it in shaders. The log at :4177 and docs/testing.md:406 overstate what happens.

Also, tools/vk_subgroup_info.py:333 reports sampler_lod_bias: False for MoltenVK with no evidence, and tests/test_vk_subgroup_info.py:826 asserts it while only mirroring the constant.

The conflict in tests/test_vk_subgroup_info.py (both add a method near :822) is trivial to rebase.

AI-assisted review, no game files, no GPU.

@Atomic258

Copy link
Copy Markdown
Contributor

Tested head 61f2aef9 — Windows 11, CPython 3.15.2 + VS 2022 BuildTools, NVIDIA RTX 5090 (driver 617.42), no game files: pass (first test on this PR).

  • python -I tests/test_vk_subgroup_info.py -> 49/49 OK. Control (main's tools/vk_subgroup_info.py + this test file): 11 failures + 1 error — the new kosmickrisp/sampler_lod_bias fields discriminate as intended.
  • python -I tools/vk_subgroup_info.py live-probes the 5090 and reports the new fields correctly: "kosmickrisp": false, "sampler_lod_bias": true (NVIDIA supports sampler LOD bias, so no fallback applies — the KosmicKrisp-only path stays dark here by design).
  • cmake --build runtime/build: clean. Regression spot-check ctest -R "d3d12_vulkan_device|d3d12_present": 2/2 Passed (d3d12_vulkan_device 10.82s, d3d12_present 1.32s).
  • git diff --check and scripts/check_no_game_data.py clean.

AI-assisted (Devin).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ran this at d90394e03 on Windows 11: pytest tests/test_vk_subgroup_info.py -q -> 50 passed, 75 subtests passed; git diff --check clean.

vk_subgroup_info now recognises KosmicKrisp and reports its sampler-LOD-bias fallback, and the runtime enables the matching path for that driver; the added cases pin the detection and the non-KosmicKrisp path. I cannot run the KosmicKrisp driver here. No blocking issue.

@wavehs
wavehs force-pushed the test-918-kosmickrisp-lod-bias branch from d90394e to 8e55d5d Compare November 23, 2026 04:55
@wavehs wavehs changed the title runtime, tools: handle KosmicKrisp sampler LOD bias fallback (TEST-918) runtime, tools: select the LOD-bias fallback on KosmicKrisp too (TEST-918) Nov 23, 2026
@wavehs

wavehs commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@tupacfan04 You are right on every point, and the PR is rebuilt around it.

The fallback the old version documented does exist — it is #1845 (SHADER-268), still open, which is why main's tools/rdna2spirv.py has no LOD_BIAS handling and why the runtime branch here could not do anything: with max_sampler_lod_bias = 0 from the device's own limit (d3d12_vulkan_device.cpp, state_.max_sampler_lod_bias), the assignment was a no-op and the log line claimed a shader-side fallback nothing implemented.

So this PR is now stacked on #1845 (Depends on #1845) and keeps only what #1845 leaves open:

Verified on this machine (M3 Pro, Homebrew Mesa), no game files: tools/vk_subgroup_info.py against the real KosmicKrisp driver answers "driver_id": 28, "kosmickrisp": true, "sampler_lod_bias": false (before: true), MoltenVK answers false; tests/test_vk_subgroup_info.py 46 OK; the runtime builds (96/96). The GPU pass of ps_ssharp_lod with the fallback is #3124's measurement, not re-run here.

Review only 8e55d5d3; the rest of the diff is #1845's commit.

@tupacfan04

Copy link
Copy Markdown
Contributor

PARTIAL: the fallback is real now, but the runtime never selects it.

At the head I checked (dc686697, newer than the d90394e0 I was pointed at), the translator fallback exists (tools/rdna2spirv.py:88,8118-8143,8641), docs/design.md:357 is rewritten, and docs/testing.md:332 matches. Tests pass: test_vk_subgroup_info.py 46 OK, docs 11, semantic LOD-bias 14 OK, compileall clean. MoltenVK evidence improved but is prose-only (the tests still simulate feature=false).

The blocking gap is the wiring: runtime/shims/d3d12_vulkan_device.cpp:7178 still sets info.sampler_mip_lod_bias directly from samplerMipLodBias and never calls sampler_mip_lod_bias(); is_kosmickrisp appears only in runtime/src/vulkan_portability.h:88. So on KosmicKrisp the runtime keeps a non-zero mipLodBias while make_game.py selects the shader fallback, double-applying the bias. runtime/test/vk_sampler_test.cpp:164 also omits properties2, so it cannot detect KosmicKrisp either.

The merge conflicts with current main 98fa503f in 12 files (including docs/design.md, make_game.py, tools/rdna2spirv.py, tools/vk_subgroup_info.py), so a rebase is needed anyway.

AI-assisted review, no game files, no game GPU.

@Vonsek

Vonsek commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested dc68669 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran ctest -R "^(d3d12_descriptor|gfx10_descriptors|vk_pipeline_check_cli)$" (3/3 on each GPU) and the full run_gpu_tests.py (includes vk_sampler_test and the ps_ssharp shaders; Radeon forced with VK_LOADER_DRIVERS_SELECT=*amd*): Radeon 176/191 passed, 15 skipped, 0 failed; RTX 5080 145/191 passed, 46 skipped, 0 failed. This does not exercise the KosmicKrisp path itself. No game files.

AI-assisted.

@memorypressure

Copy link
Copy Markdown

Verified at the PR head: tests/test_vk_subgroup_info.py passes 46 under python -I, the new test_lod_bias_fallback passes under pytest (14 + 26 subtests; like its siblings it needs the pytest venv), and main's translator-use guard passes when the test is copied onto a current-main tree. However the branch no longer merges with current main — docs/d3d12_vulkan.md conflicts; a rebase is needed and will interact with #4642's same-tuple change. The vulkan_portability.h part and the KosmicKrisp Mesa measurement are unverified here (no cmake build, no Apple hardware). No CI checks reported. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@rgvxsthi

Copy link
Copy Markdown
Contributor

An Apple M5 (MacBook Air, macOS 26.6) with Homebrew Mesa KosmicKrisp (kosmickrisp_mesa_icd.aarch64.json) and MoltenVK is available to test this on the real driver. As far as I can see, no one has run the shaders on KosmicKrisp yet.

I'm holding off at dc686697 because the wiring gap @tupacfan04 raised is still there: runtime/shims/d3d12_vulkan_device.cpp:7178 sets info.sampler_mip_lod_bias from samplerMipLodBias directly instead of calling sampler_mip_lod_bias(). vk_sampler_test and d3d12_descriptor_test do call the helper, so they would pass on KosmicKrisp while the D3D12 runtime path still double-applies the bias.

Once the fix and the rebase onto main are pushed, I'll run these on the M5:

  • tools/vk_subgroup_info.py: expect kosmickrisp: true, sampler_lod_bias: false
  • vk_sampler_test, ps_ssharp_lod and ps_ssharp_ops through run_gpu_tests.py with the fallback auto-selected
  • a control run on main, where ps_ssharp_lod should fail

AI-assisted (Claude Code).

@DomasUrbonas

Copy link
Copy Markdown
Contributor

Independent check on Apple M4 Pro, macOS 27.2.1, comparing #1845 a71346f with #4641 dc68669. With LEONIDA_LOD_BIAS_FALLBACK unset, KosmicKrisp 26.2.99 passed 2/3 sampler tests on #1845 (ps_ssharp_lod failed at point bias +1) and 3/3 on #4641. The generated metadata confirmed automatic fallback selection on #4641.

Forcing the fallback on in #1845 made ps_ssharp_lod pass. Forcing it off in #4641 reproduced the same failure. MoltenVK 1.4.2 passed all three tests on both revisions. All generated shaders passed spirv-val, and all 46 device-probe unit tests passed. Native macOS tests only. Synthetic fixtures, no game files. AI-assisted.

@wavehs

wavehs commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main dde82f27e (head 2732fbb, force-pushed) and closed the wiring gap @tupacfan04 raised: the D3D12 device now asks the helper the tests ask.

The gap. runtime/shims/d3d12_vulkan_device.cpp set info.sampler_mip_lod_bias from subset.samplerMipLodBias and is_moltenvk() directly, so KosmicKrisp — which reports the feature and ignores the bias in OpImageQueryLod — got a biased sampler from the runtime path while vk_sampler_test and d3d12_descriptor_test used leonida::sampler_mip_lod_bias() and saw the fallback. It now calls sampler_mip_lod_bias(vkEnumerateDeviceExtensionProperties, vkGetPhysicalDeviceFeatures2, info.physical, vkGetPhysicalDeviceProperties2) in the runtime too, and vk_sampler_test passes vkGetPhysicalDeviceProperties2 as well, so all three ask one function. has_portability_subset stays only for enabling the extension where it is offered.

Rebase. docs/design.md, docs/d3d12_vulkan.md, tools/rdna2spirv.py, tools/vk_subgroup_info.py, make_game.py, scripts/run_gpu_tests.py, tests/test_make_game_*.py and tests/test_shader_checks.py all conflicted, because main moved under the branch (SHADER-539's measured S# rows, image_read_typed, the MinLod/_c sample forms, per_vertex/pc-tail-ubo probe plumbing, marker-driven regen_fixtures.py, and a second --lod-bias-fallback-shaped probe for barycentric_fallback/max_push_constants_size). Where main's code was newer I kept it and re-applied this PR's change on top instead of taking this branch's older copy: the sampler dispatch, texel_offset_fold (now main's MIP_FILTER-aware version plus sbias), the auto-flag block in make_game.py (now with keep_recorded_fallback), and the flags table. The new fixtures opt into regen_fixtures.py with its ASM_MARK line, as main now requires, and were regenerated.

One translator fix the merge brought out. main sends image_sample_l on a run-time T# through the typed path, which sampled at LOD 0 and dropped the instruction's LOD; ps_ssharp_ops' image_sample_l (LOD 0.625) is the case that shows it. The typed _l path now uses the instruction's LOD, with the S#'s bias added when the flag is on.

Tested on macOS 27.2.1, Apple M3 Pro (arm64), CPython 3.15.2, MoltenVK 1.4.2 (a device whose samplers take no LOD bias), synthetic fixtures and texture only, no game files:

  • GPU, the case the PR exists for: built vk_sampler_test and translated vs_ids, ps_ssharp, ps_ssharp_ops, ps_ssharp_lod with --lod-bias-fallback, then ran every check.py case (sampler_cases) and judged the pixels with check.py's own model: 33/33 pass. The same cases on a control translated without the flag fail exactly where the bias matters (ps_ssharp "point bias +1" and "-1", ps_ssharp_ops' _d and _l, ps_ssharp_lod's queries), which is the fallback being required, not a pass.
  • python3 -I scripts/run_semantic_tests.py tests/semantic -> 448 files, 5970 tests, 64 s, 2 files failed: test_image_atomics_guard and test_image_store_d16, the same two that fail on unmodified main here (verified in a separate main checkout, same command). tests/semantic/test_lod_bias_fallback.py -> 14 tests OK.
  • tests/test_vk_subgroup_info.py -> 55 OK; tests/test_make_game_translator_flags.py -> 32 OK; tests/test_make_game_argparse.py, test_make_game_dry_run.py, test_ttpf_assets.py -> OK; tests/test_shader_checks.py -> the same 15 harness-mock errors as main.
  • cmake -S runtime -B build + build + ctest -> 64/64 pass (portable subset; vk_sampler_test builds here).
  • python3 -m compileall -q make_game.py tools tests scripts -> OK; check_no_game_data.py on the changed files -> OK. tests/test_text_write_line_endings.py fails on tools/leonida_tui.py:753 and tools/wave_diff.py:373, both from main and untouched here.

AI-assisted.

Jolymmiles and others added 2 commits November 23, 2026 20:40
…R-268)

MoltenVK reports VkPhysicalDevicePortabilitySubsetFeaturesKHR::samplerMipLodBias
false (Metal samplers have no LOD bias) and ignores mipLodBias, which with the
portability subset is also invalid usage (VUID-...-samplerMipLodBias-04467), so
ps_ssharp failed at "point bias +1" and every biased sampler read the wrong mip.

- rdna2spirv.py --lod-bias-fallback: samples apply S# word 2 [13:0] where Vulkan
  adds the sampler's bias, before the clamp: gradients x 2^bias for a 2D implicit
  PS sample (sampled with Grad from the quad derivatives), the Bias operand for
  other implicit PS samples (added to _b's), added to _l's LOD, LOD = bias for _lz, _c_lz and
  implicit samples outside the PS, gradients x 2^bias for _d/_d_cl. image_get_lod
  queries at the coordinate x 2^bias, since OpImageQueryLod's lambda' includes the
  sampler's bias. With --texel-offset-fallback, an implicit image_sample_o/_b_o
  finds the level its offset is scaled by the same way, so the device clamps
  after the bias as the sample does. A scalar-list S# (VCCTuple) reads word 2
  from its third entry. Gathers are unchanged. The index marks such shaders
  lod_bias_fallback. Without the flag all 214 GPU-test modules and index.json are
  byte-identical to ec8ec4c's.
- vulkan_sampler(..., 0) gives mipLodBias 0; the D3D12 device and vk_sampler_test
  read the portability subset (runtime/src/vulkan_portability.h), enable it where
  offered, and zero the bias where the feature is missing; vk_sampler_test also
  takes --shader-lod-bias and enumerates portability drivers behind the loader.
- vk_subgroup_info.py reports sampler_lod_bias; make_game.py and run_gpu_tests.py
  turn the flag on where it is false (LEONIDA_LOD_BIAS_FALLBACK=1/0 overrides).
- ps_ssharp_ops (image_sample_l, _b, _d, _d_cl), ps_ssharp_lod (image_get_lod at
  LOD 1 and 2, over the cases without MIN_LOD = MAX_LOD, which llvmpipe leaves out
  of the query, plus MAX_LOD 0.25) and three more SAMPLER_CASES (+0.375, bias -1
  with MIN_LOD 1, +1 with MAX_LOD 0); test_lod_bias_fallback.py.

Apple M3 Max: ps_ssharp, ps_ssharp_ops and ps_ssharp_lod pass on MoltenVK 1.4.2
with the flag (chosen by itself), and on KosmicKrisp and llvmpipe (Mesa 26.3.1)
with it forced on, plain and with LEONIDA_W64_EMULATE=1 LEONIDA_MESH_COMPUTE=1.
Natively llvmpipe passes all three and KosmicKrisp ps_ssharp and ps_ssharp_ops;
its OpImageQueryLod leaves the sampler's bias out of lambda', so ps_ssharp_lod
fails there (docs/testing.md). The D3D12 part compiles and links with clang-cl
23.1.6 and the xwin 10.0.26100 SDK; not run on Windows. AI-assisted.
…-918)

KosmicKrisp (Mesa's Metal driver, driver ID 28) reports
VkPhysicalDevicePortabilitySubsetFeaturesKHR::samplerMipLodBias as true, yet its
OpImageQueryLod leaves the sampler's mipLodBias out of the calculated LOD and adds
it, unrounded and past the last level, to the clamped one (ItsNotRexed#3124, Mesa 26.3.1 on an
M3 Max). ps_ssharp_lod therefore fails there while the probe says the samplers take
a bias, and make_game.py translates without --lod-bias-fallback: the driver drops
the S#'s bias from the LOD query and nothing applies it.

This is the one piece ItsNotRexed#1845 (SHADER-268) leaves open: it selects the fallback from
the portability subset's samplerMipLodBias feature, which KosmicKrisp reports as
present, and documented the KosmicKrisp failure as needing
LEONIDA_LOD_BIAS_FALLBACK=1 by hand.

- tools/vk_subgroup_info.py: sampler_lod_bias is false for driver ID 28, whatever
  the feature says, and the answer carries kosmickrisp.
- runtime/src/vulkan_portability.h: sampler_mip_lod_bias() is false for driver ID 28
  (is_kosmickrisp, by the driver ID as is_moltenvk is, since the extension may not be
  in sight), so vulkan_sampler() creates samplers with mipLodBias 0 and the shaders
  translated with --lod-bias-fallback apply the S#'s bias there, as on MoltenVK.
  Older Vulkan headers get the driver ID constant.
- docs/design.md: how sampler_lod_bias is chosen now; docs/testing.md: the
  ps_ssharp_lod row says the tooling selects the fallback for KosmicKrisp.
- tests/test_vk_subgroup_info.py: a KosmicKrisp device that reports the feature
  (with and without VK_KHR_portability_subset), MoltenVK, and an AMD device that
  keeps the bias.

Depends on ItsNotRexed#1845. The PR diff shows ItsNotRexed#1845's commit as well: this one is the last
commit, 205810f3.

Tested on macOS 27.2.1 (Apple M3 Pro, CPython 3.15.2), no game files:
- python -I tests/test_vk_subgroup_info.py -> 46 tests OK.
- tools/vk_subgroup_info.py against the real drivers on this machine:
  KosmicKrisp (Homebrew Mesa, driver 28) -> "kosmickrisp": true,
  "sampler_lod_bias": false; MoltenVK (driver 14) -> "sampler_lod_bias": false.
  Before this change the same KosmicKrisp device answered true, which is the bug.
- tests/test_docs_design_rows.py, test_docs_links.py, test_docs_repo_paths.py,
  test_make_game_translator_flags.py, test_shader_checks.py -> OK;
  python -m compileall -q tools tests -> OK.
- cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo and
  cmake --build runtime/build -> 96/96 targets, clean.

The GPU result ps_ssharp_lod passes with the fallback on KosmicKrisp is ItsNotRexed#3124's and
automatic, and was not re-run on a GPU here. AI-assisted.
@wavehs
wavehs force-pushed the test-918-kosmickrisp-lod-bias branch from 2732fbb to 86e11f3 Compare November 23, 2026 18:44
@wavehs

wavehs commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased again onto main 6dda0630b (head 86e11f3): #6789 added its own probe (runtime_gpu_mesh_draws_crash / --native-mesh) to the same auto-flag block in make_game.py and to the same two test helpers this PR extends, so the rebase keeps both patches and both tests. --mesh-compute still comes before the push-constant check (152 bytes on a 144-byte Intel device), --lod-bias-fallback after it, as before.

Re-tested at the new head: tests/test_make_game_translator_flags.py 34 OK, test_make_game_argparse.py OK, test_make_game_wave64.py OK, test_make_game_preflight.py OK, test_make_game_dry_run.py OK, tests/semantic/test_lod_bias_fallback.py 14 OK, tests/test_vk_subgroup_info.py 55 OK; the portable runtime builds and its vk_sampler_test still compiles; run_semantic_tests.py is the same two main-red files (test_image_atomics_guard, test_image_store_d16). AI-assisted.

@rideinstead

Copy link
Copy Markdown

✅ Automated security review: CLEAN (commit 86e11f3d)

  • No findings.

Scope: static analysis of added diff lines only; no code was executed. Please review findings manually.

@emreYilmaz28845

Copy link
Copy Markdown

Tested 86e11f3da5ebd34141f6723084850a9820eaa408 (select the LOD-bias fallback on KosmicKrisp too, TEST-918) on Windows 11 with RTX 5070 Ti (driver 621.1) and AMD Radeon RDNA2 iGPU gfx1036 (2.0.353): pass for everything runnable on this machine — first functional check of this head (the thread's earlier checks were older heads, plus a static-only scan here). AI-assisted. No game files used.

Windows 11, MSVC 14.44.35207 (VS Build Tools 2022, -G "Visual Studio 17 2022" -A x64, RelWithDebInfo), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Python 3.13.16. Worktree at the head as pushed, no extra commits; the head is still 86e11f3 after the run.

CPU, translator (the main change, tools/rdna2spirv.py +152/−23):

  • Full semantic suite, python -I scripts/run_semantic_tests.py tests/semantic: 448 files, 5970 tests, 446 files pass in 54 s. The 2 failing files — test_image_atomics_guard (47 failures) and test_image_store_d16 (1) — fail identically on plain main 867d922f0 (verified with python -I -m unittest discover per file), so they are pre-existing, not from this PR; pinned as a finding on the coordination issue: 9065 (comment).
  • python -m pytest tests/semantic/test_lod_bias_fallback.py tests/test_make_game_translator_flags.py (venv per tests/requirements.txt): 48 passed + 49 subtests — the PR's new translator test and the flag plumbing both green.
  • python -I tests/test_vk_subgroup_info.py: OK (46 tests; covers the tools/vk_subgroup_info.py change). python -I tests/test_make_game_argparse.py: OK. python -m compileall -q make_game.py tools tests: clean.
  • python -I tests/test_shader_checks.py: 15 TypeErrors — pre-existing on main (runtime/test/shaders/check.py:648,1143 pass cwd= to the stub harness() functions whose signatures in the test do not take it); fails identically on plain main. Pinned as a finding: 9065 (comment). This PR's +74/−3 to that file inherits the breakage, so its own additions there could not be exercised under python -I.

GPU, runtime wiring (d3d12_vulkan_device.cpp, gfx10_descriptors.h, vulkan_portability.h):

  • ctest -R "^(d3d12_descriptor|gfx10_descriptors)$" on both GPUs, validation off and LEONIDA_VK_VALIDATION=1 on: pass everywhere, 0 validation errors — literal sampler bias −32/+31, the minimum-LOD 1D/array/cube/volume cases, depth SRVs, the descriptor-copy and bindless sampling set on both vendors.

Not covered by this run: vk_sampler_test and the ps_ssharp* GPU fixtures — runtime/test/shaders/build.py needs llvm-mc (absent on this machine), and the KosmicKrisp driver is Apple-side (covered on the thread by the M4 Pro/M5 runs). The shader-side fallback behaviour is therefore verified here at the translator level only (the semantic fixtures ps_ssharp.s, ps_ssharp_lod.s, ps_ssharp_ops.s and test_lod_bias_fallback.py), not on a GPU.

Negative control (runtime level). Reverting tools/rdna2spirv.py to the merge base dfe4e4ad3 and re-running pytest tests/semantic/test_lod_bias_fallback.py: 12 failed, 1 passed, 3 errors (against 48 passed + 49 subtests at the head) — the pass depends on this PR's translator change, not on the fixtures alone.

Commands: the semantic suite, pytest and python -I lines above, plus cmake -S runtime -B runtime/build -G "Visual Studio 17 2022" -A x64, cmake --build runtime/build --config RelWithDebInfo --target d3d12_descriptor_test gfx10_descriptors_test vk_sampler_test, then the ctest line with LEONIDA_VK_DEVICE=NVIDIA|AMD and LEONIDA_VK_VALIDATION=1, one GPU at a time.

@optinium51-bot

Copy link
Copy Markdown

Tested 86e11f3da merged onto main 5d74c2723 (clean merge) on NVIDIA GeForce RTX 3060 (driver 616.92), Windows 11 26200, MSVC 14.52 (VS 2026), RelWithDebInfo + Ninja: pass.

No game files. AI-assisted (Claude Code).

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.