Commit Graph

18 Commits

Author SHA1 Message Date
ca8a627c5c bary_fallback_gs: restore write mode before unlink on replace failure and publish mode (BARY-FALLBACK-GS-STAGE-CLEANUP)
Apply published_mode(asm/spv) to temporary files before atomic replacement,
and restore write permission (0o600) before directory cleanup in exception block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.

agent: yes
AI-assisted: yes
2026-11-29 18:24:17 +03:00
e726995fa9 bary_fallback_gs: validate input locations/index schema/shader names, accept UTF-8 BOM, and publish atomically (BARY-FALLBACK-GS-VALIDATION-ATOMIC) 2026-11-25 01:17:56 +01:00
5bc4d4f764 Merge pull request #478 from kotekompotek/work/bary-fallback-gs-validate-bary-loc
Why merged: a bool or negative bary_location is refused before any SPIR-V is generated.
Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: 28 -> 29 tests OK (the new test fails on main); the only caller passes a JSON int.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 01:59:13 -05:00
10417ec0f5 bary_fallback_gs: reject negative or bool bary_location 2026-11-24 09:10:59 +05:00
51931245d5 docs: point 15 more tools at their --help usage line (#5535)
Squash-merged after review of PR #5535 - docs: point 15 more tools at their --help usage line
2026-11-23 08:09:32 -06:00
e95b5b50b8 Merge pull request #3778 from Tomgamer 2026-11-22 17:03:44 -05:00
fa33dd1616 Merge pull request #3647 from Kam471 2026-11-22 17:03:11 -05:00
45eeabf068 bary_fallback_gs: reject non-object index entries in --pair
A non-object VS or PS entry crashed --pair with AttributeError; it now
exits 1 with a one-line error naming the entry and the index path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:34:43 +01:00
d1490e359e BUILD-1046: missing inputs exit 2; image_query_probe help before oracle
Eleven tools treated a nonexistent input folder as a failed run (1). They now print one ERROR line and return 2, while real read failures keep exit 1. image_query_probe imports the hardware oracle only for a GPU run, so --help stays prompt. A table-driven subprocess test covers all eleven; existing expectations are updated.
2026-11-22 21:11:07 +00:00
e481744109 Merge pull request #2810 from Vonsek 2026-11-22 15:12:13 -05:00
ea9fa63730 fix(tools): stage fallback shader assembly before validation
Keep the published assembly paired with its binary when a replacement fails validation.
2026-11-22 20:36:12 +01:00
8043d34437 fix(tools): publish barycentric helpers after validation
A failed rebuild could overwrite the validated helper with a binary that rendering could no longer load. Keep the previous helper available until validation of its replacement succeeds.
2026-11-22 19:20:44 +01:00
f0f0eea1e6 fix(build): reject non-object barycentric shader indexes
A malformed translation index could make the fallback geometry shader build report success without generating any helpers.
2026-11-22 17:44:30 +01:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
1968dcdfa2 bary_fallback_gs: a missing spirv dir is an error, not an empty success
`bary_fallback_gs.py <dir>` with a path that does not exist (a typo, the wrong work folder) found no
index.json, built nothing and exited 0 with no output, so it looked like a successful run. It now exits 1
with `<dir>: not a directory`. build_for_index / write_for_index are unchanged: an existing directory
without index.json still means nothing to do.
2026-11-22 16:02:16 +05:30
18ebc2530d fix(shader): preserve vertex cull distances in barycentric helpers
A PS-only geometry helper cannot recover primitive culling from the fragment interface. Use the declared VS array for an explicit pair so fully negative primitives are discarded on the fallback path.
2026-11-22 10:32:31 +01:00
94a29af1fd fix(shader): preserve clip distances in paired barycentric helpers
A geometry shader becomes the last stage before clipping and must forward the producing vertex shader's clip array. Key an explicitly paired helper by the array length so distinct pipelines retain independent clip layouts.
2026-11-22 09:50:42 +01:00
4030a386fb Translator: --bary-fallback for raw barycentrics without VK_KHR_fragment_shader_barycentric (SHADER-98)
The 321 pixel shaders that read the raw barycentric pair are translated to
BuiltIn BaryCoordKHR, so they can't run on a device without the extension
(NVIDIA Pascal, for one). With --bary-fallback the pair comes from an
ordinary vec3 input one location past the shader's attributes; the module
needs neither the capability nor the extension, and the index records the
location as bary_fallback_input. tools/bary_fallback_gs.py writes the
pass-through geometry shader that fills it: Position and the PS's inputs
copied unchanged, plus (1,0,0), (0,1,0), (0,0,1) at the three vertices,
whose perspective interpolation is the BaryCoordKHR value.

- LEONIDA_BARY_FALLBACK=1 for build.py, check.py and run_gpu_tests.py
  (like LEONIDA_W64_EMULATE): translate with the flag, build
  <name>.bary_gs.spv, draw those shaders through it.
- vk_harness: VKH_GS_HELPER=1 keeps VKH_SUBGROUP_SIZE on the fragment
  stage when the GS only feeds the pixel shader under test.
- tests/semantic/test_bary_fallback.py and the ps_bary fixture.
- docs/design.md contract row and index key, docs/testing.md section.

GTX 1060 (Pascal): ps_bary 4096/4096 exact, ps_uniform_branch and
ps_scc_mask32 pass with the fallback (SKIP without it). Pixel-shader corpus:
12,101/12,101 translate and pass spirv-val with and without the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSJXX67xeoorUsLJ2f9zms
2026-11-21 22:28:25 -08:00