Fix glowing foliage stems and branches (register marker collisions) #759

Merged
pelicanux merged 1 commit from fix/native-register-marker-collisions into main 2026-11-09 04:59:40 +00:00
pelicanux commented 2026-11-08 20:14:03 +00:00 (Migrated from github.com)

Fix bright red/green stems in nearby foliage by keeping register-renaming markers separate from every original operand.

Marker allocation checks native_high while it is still being populated. A marker chosen for an early field can therefore alias a later source. Ordinary GPRs below reserved_base can collide as well. The fix surveys the original operand spans first, then excludes them from marker allocation, preserving the existing pair/quad handling.

The regression generates synthetic FFMA instructions and checks the effective destination and all three sources after REGMAP decoding. It covers both reserved-bank configurations, later sources and repeated destination/addend operands. The existing CI runner discovers it automatically; no workflow changes are needed.

Validation:

  • Regression: 11 failures before the fix, 0 failures across 89 cases afterward; passes with Clang and GCC.
  • Full Linux game-free suite: 104 passed, 4 skipped (checks requiring the game or a GPU).
  • Local in-game A/B on a build based on 71e59e3, with the same earlier fixes on both sides: Kokiri stems retain natural colors and leaves remain visible. Tested on RX 9070, RADV/Mesa 26.2.6, with frame generation disabled; a further run without overlay or diagnostic instrumentation confirmed the result.
  • Generated mesh SPIR-V passed Vulkan 1.3 validation with uniform-buffer-standard-layout.

Addresses the glowing-branch symptom in #667. Only the lowering fix, its synthetic regression and the test-runner entry are included.

Fix bright red/green stems in nearby foliage by keeping register-renaming markers separate from every original operand. Marker allocation checks `native_high` while it is still being populated. A marker chosen for an early field can therefore alias a later source. Ordinary GPRs below `reserved_base` can collide as well. The fix surveys the original operand spans first, then excludes them from marker allocation, preserving the existing pair/quad handling. The regression generates synthetic FFMA instructions and checks the effective destination and all three sources after REGMAP decoding. It covers both reserved-bank configurations, later sources and repeated destination/addend operands. The existing CI runner discovers it automatically; no workflow changes are needed. Validation: - Regression: 11 failures before the fix, 0 failures across 89 cases afterward; passes with Clang and GCC. - Full Linux game-free suite: 104 passed, 4 skipped (checks requiring the game or a GPU). - Local in-game A/B on a build based on `71e59e3`, with the same earlier fixes on both sides: Kokiri stems retain natural colors and leaves remain visible. Tested on RX 9070, RADV/Mesa 26.2.6, with frame generation disabled; a further run without overlay or diagnostic instrumentation confirmed the result. - Generated mesh SPIR-V passed Vulkan 1.3 validation with uniform-buffer-standard-layout. Addresses the glowing-branch symptom in #667. Only the lowering fix, its synthetic regression and the test-runner entry are included.
Commenting is not possible because the repository is archived.
No description provided.