Skip to content

fix(kyty): lower private LDS append and consume - #310

Draft
mjnhbg3 wants to merge 1 commit into
simnJS:AnyKytyfrom
mjnhbg3:fix/kyty-private-lds-append-consume
Draft

mjnhbg3 wants to merge 1 commit into
simnJS:AnyKytyfrom
mjnhbg3:fix/kyty-private-lds-append-consume

Conversation

@mjnhbg3

@mjnhbg3 mjnhbg3 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What

A three-word vertex or pixel shader using DS_APPEND or DS_CONSUME still emits OpAtomicIAdd or OpAtomicISub against per-invocation LDS. Vulkan rejects those storage classes. This is a distinct recurrence after #291 and follows the same private-LDS rule: load the old value, add or subtract, then store it. Workgroup LDS and GDS keep native atomics, and the first-lane result broadcast is unchanged. Handwritten stage fixtures now require a nonempty SPIR-V module as well as validator acceptance. A debt fragment records that the console behavior outside compute workgroups remains unmeasured.

Based on current AnyKyty 9ceedb540940a47ab6c4b290d4c355643cdf043d. Issue #209 stays open until the one-hour fuzz acceptance gate completes.

Tested

  • On exact base 9ceedb5409, the Linux ASan/UBSan fuzzer reproduces both invalid atomic opcodes with three-word Vertex and Pixel inputs. Compute append and consume controls validate. No game-derived shader was used.
  • Windows 11 Pro build 26200, WinLibs GCC 15.2 and LLVM 21: focused targets built; kyty_shim_recompiler_robustness and kyty_shim_recompiler_valid_spirv passed 2/2. Five new handwritten cases each emitted nonempty SPIR-V; the latter test validates them with KYTY_FUZZ_SPIRV=abort.
  • Same Intel(R) Graphics, driver 32.0.101.8331, and same machine: kyty_shim_cross_queue_label_order and kyty_shim_recompiler_valid_spirv passed 2/2 on merged base and patch with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer. Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" using layer 1.4.363, no missing-layer warning, and zero VUID- errors. The first candidate cross-queue run timed out at 25 seconds; it passed on rerun and in the fresh base/candidate comparison.
  • Genuine PGO advisory fixtures 7/7, relinker warning fixtures 9/9, and Kyty settings fixtures 19/19 passed. All 87 live KYTY_* settings are documented. Replaying both the merged-base Linux Kyty CI log and the PR Linux Kyty CI log through tools/kyty_pgo.py report --annotate emits exactly the same genuine advisory: 423 functions lost profile counts, 18.95% of profile weight, four of ten hottest. The resulting ::warning lines match exactly.
  • tools/check_conventions.py --base origin/AnyKyty, tools/check_kyty_settings.py, tools/debt_fold.py --check, and git diff --check passed. tools/pr_overlap.py --branch failed closed on draft feat(kyty): read V#-described buffers by mirror address behind KYTY_E2_VSHARP_MIRROR #181 because that PR conflicts with the current base; manual comparison of its spirvEmitterMemory.cpp hunks shows only buffer address/load and EmitReadConstBuffer changes, separate from this PR's EmitAppendConsume hunk. No other open PR shares files or exports.
  • AnyKyty CI (Windows, Linux, ASan, TSan), offline checks (lavapipe and relinker fuzzers), Emscripten portability, and Conventions passed at 67f961e. The one-hour fresh-corpus Linux compiler/validator fuzz is still running. No title or homebrew was run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Intel(R) Graphics, driver 32.0.101.8331, Windows 11 Pro build 26200
  • AI-assisted: yes

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.

1 participant