Shader corrections, batch 001

Snapshot: this page records this batch of shader corrections, as it was made. The code has changed since, and the page is not kept up to date.

Index

This is a bounded corrective patch, not an implementation of every finding in instructions.md. Eden is authoritative for this batch.

The diff is independent of the earlier NRO/HLE patches and the annotation-only patch. No existing NRO/HLE changes are included or reverted.

Corrections

Annotation errata discovered during implementation

The historical ledger's MOV32I claim that no local data difference was found is incorrect for masks other than 1/15. Its PSETP claim that the two-stage boolean equation already matched is also incorrect. Eden's second result is ((!A) BOP1 B) BOP2 C, not (!(A BOP1 B)) BOP2 C. Both corrections are tested here. The earlier annotation package remains a historical source review, not a certificate that every semantic difference was found.

Executed evidence

This section records a historical audit of the removed text translator. Its differential harness was retired with that translator; the figures below describe the old implementation.

The semantic comparison executes actual frontend outputs through two bounded CPU adapters. It does not execute Eden's backend or either shader on a GPU. The GLSL/SPIR-V check is compilation and validation only. No game was run.

Deliberately unresolved

Most of the original ledger remains open. In particular, this patch does not fix IADD/IADD3/ISCADD, extended comparisons, all condition flags, general FP rounding/FTZ, textures, resource tags, memory, atomics, barriers, subgroup semantics, stage coverage or general CFG/call/return behavior. VOTE's predicate aliasing is not fixed by the predicate helper change.

BFI still clamps count to the remaining width. Eden can emit an out-of-range bitfield operation when count is at most 32 but exceeds the remaining width. Those cases have no successful backend oracle here and are excluded from the semantic claim. Invalid I2I selectors and rejected SHF modes use ScarletNX's existing diagnostic mechanism, which is not equivalent to Eden throwing an exception. Full rejection/error policy remains unresolved.

F2I testing covers finite F32-to-S32 values and all ABS/NEG/rounding combinations in reg/cbuf forms. NaN conversion results, 64-bit formats, FTZ and CC remain open. The shared field correction also reaches ScarletNX's immediate extension, which Eden rejects and which is not reference-validated. P2R reg/cbuf extensions remain unvalidated. MOV/MOV32I resource-tag invalidation is still incomplete.

Reference source and licensing

All paths below are under Eden's src/shader_recompiler/frontend/maxwell/ at the pinned revision:

The referenced visitor files and opcode table credit the 2021 yuzu Emulator Project under GPL-2.0-or-later. Eden support files also retain their Eden copyright and GPL-3.0-or-later notices. They are compiled from the user's unchanged checkout, not copied into this patch. ScarletNX's GPL-3.0-or-later notices are preserved.


Made from docs/history/shader-audit/fixes-001.md at 69237645142c. GPL-3.0-or-later.