Shader tests: snapshot of which ALU instructions lower (catches lowerings lost in a merge) #81
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/81"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from uiliannn/VItoriaBr. Originally posted by lcg007xd-c on 2026-11-25T22:04:35Z.
What
A tripwire against losing lowerings. Issue #4 records lowerings that went missing in a merge (
image_sample_b_o, the LDS bounds checks). Nothing noticed until a title broke.The new test
lowering_coverage_matches_the_snapshot(emit/coverage_tests.rs) works like this:s20, which stays clear of the buffer descriptor ins[8:11].emit/lowering-coverage.txt(743 lines, 24 KB).vop1 0x02a v_rcp_f32: lowers -> refused. By default it only prints that as a warning and passes, so no one else's PR goes red over it. WithVICTORY_STRICT_TESTS=1(the switch #43's skips already use) it fails.VICTORY_BLESS=1 cargo test -p victory-shader coverage, and the updated list is committed with it.The whole sweep takes about 0.6 s.
Today, 544 of the 743 named opcodes lower, 197 are refused, and 2 panic. The 2 are
v_permlane16_b32andv_permlanex16_b32, and #79 fixes them. Once #79 merges, they show up as a warning until the list is re-blessed.Tests
v_rcp_f32arm fromlower.rslocally. The test then named both encodings (vop1 0x02aandvop3 0x1aa,lowers -> refused). In the sandbox, a stale list passes with a warning by default and fails withVICTORY_STRICT_TESTS=1.--target x86_64-pc-windows-msvc) pass locally. The asset-policy test accepts the new.txt.Open lowering PRs (#56, #57, #71, #73) keep passing after this merges. Their new lowerings show up as warnings until someone re-blesses the list.
Not covered: instructions that need more than this template (VOPC, memory, images, branches). The test only shows that an opcode lowers or is refused, not that the result is numerically right.
🤖 Generated with Claude Code
Imported from uiliannn/VItoriaBr. Originally posted by lmouz823-lang on 2026-11-28T08:05:47Z.
I can take native Windows snapshot validation at exact head
ef660b0b012273a15d7b5682e9b6aeb3170a93c1. I will run the ALU sweep, audit the recorded lowers/refused/panic counts and the ordinary/strict/bless paths, then propose a minimal justified regression or fix for any uncovered integrity gap. Negative controls and restored-source verification will accompany the result, with explicit panic allowances, skipped tests and numerical/GPU/game limits. AI-assisted with Codex.Imported from uiliannn/VItoriaBr. Originally posted by lmouz823-lang on 2026-11-28T08:18:47Z.
Native Windows validation and snapshot-parser repair completed for exact head
ef660b0b012273a15d7b5682e9b6aeb3170a93c1. The original strict exact test executes one test and passes. The generated snapshot agrees byte-for-byte with the committed 743-row file on this machine.The 743 outcomes consist of 544
lowers, 197refused, and 2 caughtpanics. The panic rows arevop3 0x377 v_permlane16_b32andvop3 0x378 v_permlanex16_b32. They are part of the recorded classification. The probe generates 1,728 templates from VOP1/2/3/3P and SOP1/2, and itsname()path produces the 743 snapshot rows.I found a snapshot parsing gap through the existing test entry point.
filter_map(rsplit_once)silently drops a line without a separator, andBTreeMap::collectsilently replaces an earlier duplicate case. Appending either kind of corruption leaves the original strict test passing. Missing cases and ordinary status changes already produce comparison diagnostics.The attached +10/-4 test-harness patch parses each row explicitly and appends malformed-row or duplicate-case diagnostics to the existing
changeslist. The existing warning/strict policy then handles those diagnostics.malformed_snapshot_entry, strictVICTORY_BLESS=1, then rerun strictI also checked the existing environment interaction. Blessing runs before comparison, including with strict mode enabled. The flag is presence-based, so
VICTORY_BLESS=0also rewrites the snapshot. Both behaviors were exercised through fresh child processes. The generated file was byte-identical to the original snapshot in the tested cases.After restoring the original snapshot bytes, I cleaned only the isolated shader-package target and confirmed a fresh 13.06-second compilation. The final strict and ordinary selections each execute one test and pass, with zero ignored tests or runtime skip diagnostics. The snapshot SHA256 is
0899c7580e081424aac104db080bfd6fb199b2d3eb41b5224ebb1dfd6404f8f5.Package Clippy with
--all-targets -- -D warnings, whole-file rustfmt on original and final source,git diff --check, and asset policy (198 files) pass. Environment was Windows 11 build 26200, Rust 1.98.1 MSVC, default test profile and an isolated target.Scope is the synthetic lowering-outcome snapshot and its parser/mode behavior. Each opcode uses one operand template. The scalar template stores one result dword. Alternative encodings, full-width results, SCC semantics, numerical results, DXIL/GPU execution, game behavior, other platforms and the remaining shader/workspace suites remain unverified. The two recorded panic outcomes were observed as part of snapshot agreement.
Reproduce the final exact test after applying the attached patch, with blessing cleared for comparison.
AI assistance from Codex covered the audit, patch, execution and this report.
Snapshot-parser diagnostics patch against this head
Pull request closed