Proposal: evaluate the packed f16 special-value rules only on lanes that can need them #4042

Open
opened 2026-10-11 21:58:13 +00:00 by queeeef · 8 comments
queeeef commented 2026-10-11 21:58:13 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-11T21:58:13Z.


Problem

Every packed f16 instruction applies RDNA's special-value rules on both halves:

  • which input NaN is returned, and its quieting in IEEE mode;
  • the default NaN 0xfe00 for an invalid operation (inf * 0, inf - inf);
  • FP16_OVFL;
  • for min/max, the NaN operand selection.

These rules are exact and tested against hardware. They are also most of the instructions the recompiler emits for packed f16 math, although they only change a result when an input is NaN, or when the result is NaN or infinite.

IR values per instruction (APS5_LOCAL_IR_HISTOGRAM, a local counter), for the two most expensive shaders of Palworld (PPSA23126) on its title screen:

Instruction Count in the two shaders IR values per instruction
v_pk_fma_f16 482 206–227
v_pk_fmac_f16 72 227
v_pk_min_f16, v_pk_max_f16 682 129–134
v_pk_add_f16, v_pk_mul_f16 566 103–107
v_min3_f16, v_max3_f16 1220 97–100

With native f16 math (#3531, and a follow-up using OpFmaKHR from VK_KHR_shader_fma for the fma) the arithmetic itself is one instruction. Almost everything left is the rules. #3531 already measured this on an RTX 4060: "Most of what's left in each instruction is the NaN rule on the result bits."

Measurement

Setup:

  • RTX 2080 Ti, NVIDIA 610.74, Windows 11.
  • Palworld title screen, idle, APS5_PROFILE_GPU, shader cache off.
  • Three 10 s windows per build, same scene.

Builds:

  • Exact (today): current packed f16 translation, with #3531 and #3590.
  • + native fma: v_pk_fma_f16 and v_pk_fmac_f16 as native f16x2 math.
  • No special-value rules: like the previous build, and the whole block that applies the special-value rules in packedFloat16 is skipped (with the clamp inside it). This is not correct: it is only the upper bound of what the rules cost.
Build Presents / 10 s GPU time / 10 s Shader 0x1a01… per frame Shader 0x1bc1… per frame
Exact (today) 181–184 6365 ms 16.5 ms 8.4 ms
+ native fma 188–191 6155 ms 15.8 ms 6.9 ms
No special-value rules (upper bound) 223–226 5413 ms 10.4 ms 3.8 ms

These two compute shaders take 25 of the 35 ms of GPU time per frame. Without the rules they take 14 ms, and the frame rate goes up by 22% with every other cost unchanged. The scene is GPU-bound (93% busy at 1860 MHz), so the saving shows up directly as frame rate.

Proposal

Keep the rules exactly as they are, but run them only for the lanes that can need them.

For each packed f16 instruction:

  1. Fast path. Compute the result as today: native f16x2 where available, the f32 path otherwise. Clamp stays here.
  2. Guard. Compute one boolean for both halves: "an input half is NaN, or the result half is NaN, or FP16_OVFL is set and the result half is infinite". With SWAR this is a few instructions on the packed words, for example for the NaN part:
    anyNan = (((a & 0x7fff7fff) + 0x03ff03ff) | ((b & 0x7fff7fff) + 0x03ff03ff) | ((c & 0x7fff7fff) + 0x03ff03ff) | ((r & 0x7fff7fff) + 0x03ff03ff)) & 0x80008000
    
    A 15-bit magnitude above 0x7c00 sets bit 15 of its half, and no carry crosses into the other half.
  3. Slow path. If the guard is set, run today's rule code unchanged, in a branch: if (guard) { result = rules(result) }. A thread whose inputs and result are ordinary numbers never runs it.

Why the result is bit-identical: the rules return the fast-path result unchanged whenever the guard is clear. The rule code is today's code, so the existing hardware-oracle tests cover it, and #3531's differential test already generates NaN, infinity, denormal and overflow inputs on every lane.

Expected cost per packed instruction: the arithmetic plus about 10 guard instructions, instead of 100–227 IR values today. Most of the upper-bound gain above should remain; the prototype will measure how much.

Pros

  • Exact. It adds no new assumption about hardware or drivers, unlike approximations or dropping rules behind a setting.
  • Large and general saving. Palworld is an Unreal Engine title, and any title whose shaders are compiled with 16-bit types runs these instructions. Its title screen alone would gain up to 22% frame rate. In other scenes and titles, the saving scales with how much of the frame is f16 math.
  • The same pattern applies beyond packed math:
    • scalar f16 min3/max3/min/max, about 60–100 IR values each and 1924 instructions in the same two shaders;
    • scalar v_fma_f16, v_rcp_f16;
    • the f32 NaN rules in nanResultF32.
  • Complements the native-math PRs (#3531, OpFmaKHR). Those remove the arithmetic cost; this removes most of what they leave.
  • Small to review. The rule code moves into a branch and isn't rewritten.

Cons and mitigations

  • Divergence.
    • Risk: if one thread of a wave has a NaN, that wave runs both paths and costs today's price plus the guard.
    • Mitigation: NaN and infinity are rare in rendering math, and usually a bug in the title when they occur. Even in the worst case, a wave with NaNs on every instruction, the cost only rises by the guard, about 10 instructions per packed instruction. The prototype will count how often the guard fires in Palworld, so this is measured, not assumed.
  • Control flow inside a translated block.
    • Risk: the translator creates one IR block per RDNA block.
    • Mitigation: the slow path contains no subgroup operations, derivatives, memory accesses or image sampling, so its position doesn't matter for wave or quad semantics, and execution reconverges at the merge before the next instruction. The SPIR-V backend already emits branches with an OpPhi inside one IR instruction (SpirvBdaRead.cpp, SpirvImageEmitter.cpp), so the branch can live entirely in the backend.
  • Code size and compile time.
    • Risk: the module gains the guard and a branch per instruction, so SPIR-V size and driver compile time change.
    • Mitigation: the slow path is the code emitted today. The prototype will report SPIR-V words and pipeline compile time.
  • Register pressure.
    • Risk: the driver allocates registers for the largest path, so occupancy may not improve.
    • Mitigation: the saving comes from instructions not executed, not from occupancy. The upper-bound measurement shows that saving.
  • One title, one GPU.
    • Risk: the numbers come from one scene on one NVIDIA GPU.
    • Mitigation: the prototype PR will repeat #3531's per-instruction chain timing on at least NVIDIA and lavapipe, and the Palworld scene measurement.

Implementation options

  1. A backend lowering. One IR opcode per rule family, carrying the operand bits, the fast result and the mode flags as immediates. The SPIR-V backend emits the guard, the branch and the existing rule code. This keeps the IR straight-line, and the branch stays where the backend already makes branches. I'd start here.
  2. A generic "rare select". The IR marks Select(cond, fast, slow) as rarely taken, and the backend sinks the values used only by slow into a branch. This is more general, so the f32 rules would come for free, but it's a larger change to the backend.
  3. Splitting the translated block. A conditional block inside the translation. This touches the translator's block model, and I would avoid it.

Plan

  1. A prototype PR for packed add, mul and fma with option 1, including:
    • a differential test against the current rules on the NaN, infinity and overflow rows #3531 generates;
    • a test that forces every lane through the slow path;
    • a counter of how often the guard fires, behind a profiling variable;
    • #3531-style chain timings and the Palworld measurement.
  2. If accepted, packed min/max, then the scalar f16 instructions.

Questions

  • Is option 1 acceptable, or would you rather have the generic option 2?
  • Is per-thread control flow inside an instruction acceptable for the recompiler's exactness rules, given that the rule code itself does not change?

AI-assisted (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5805600904 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042). Originally posted by [queeeef](https://github.com/queeeef) on 2026-10-11T21:58:13Z. --- ### Problem Every packed f16 instruction applies RDNA's special-value rules on both halves: - which input NaN is returned, and its quieting in IEEE mode; - the default NaN `0xfe00` for an invalid operation (`inf * 0`, `inf - inf`); - `FP16_OVFL`; - for min/max, the NaN operand selection. These rules are exact and tested against hardware. They are also most of the instructions the recompiler emits for packed f16 math, although they only change a result when an input is NaN, or when the result is NaN or infinite. IR values per instruction (`APS5_LOCAL_IR_HISTOGRAM`, a local counter), for the two most expensive shaders of Palworld (PPSA23126) on its title screen: | Instruction | Count in the two shaders | IR values per instruction | |---|---|---| | `v_pk_fma_f16` | 482 | 206–227 | | `v_pk_fmac_f16` | 72 | 227 | | `v_pk_min_f16`, `v_pk_max_f16` | 682 | 129–134 | | `v_pk_add_f16`, `v_pk_mul_f16` | 566 | 103–107 | | `v_min3_f16`, `v_max3_f16` | 1220 | 97–100 | With native f16 math (#3531, and a follow-up using `OpFmaKHR` from `VK_KHR_shader_fma` for the fma) the arithmetic itself is one instruction. Almost everything left is the rules. #3531 already measured this on an RTX 4060: "Most of what's left in each instruction is the NaN rule on the result bits." ### Measurement **Setup:** - RTX 2080 Ti, NVIDIA 610.74, Windows 11. - Palworld title screen, idle, `APS5_PROFILE_GPU`, shader cache off. - Three 10 s windows per build, same scene. **Builds:** - **Exact (today):** current packed f16 translation, with #3531 and #3590. - **+ native fma:** `v_pk_fma_f16` and `v_pk_fmac_f16` as native f16x2 math. - **No special-value rules:** like the previous build, and the whole block that applies the special-value rules in `packedFloat16` is skipped (with the clamp inside it). This is **not correct**: it is only the upper bound of what the rules cost. | Build | Presents / 10 s | GPU time / 10 s | Shader `0x1a01…` per frame | Shader `0x1bc1…` per frame | |---|---|---|---|---| | Exact (today) | 181–184 | 6365 ms | 16.5 ms | 8.4 ms | | + native fma | 188–191 | 6155 ms | 15.8 ms | 6.9 ms | | No special-value rules (upper bound) | 223–226 | 5413 ms | 10.4 ms | 3.8 ms | These two compute shaders take 25 of the 35 ms of GPU time per frame. Without the rules they take 14 ms, and the frame rate goes up by 22% with every other cost unchanged. The scene is GPU-bound (93% busy at 1860 MHz), so the saving shows up directly as frame rate. ### Proposal Keep the rules exactly as they are, but run them only for the lanes that can need them. For each packed f16 instruction: 1. **Fast path.** Compute the result as today: native f16x2 where available, the f32 path otherwise. Clamp stays here. 2. **Guard.** Compute one boolean for both halves: "an input half is NaN, or the result half is NaN, or `FP16_OVFL` is set and the result half is infinite". With SWAR this is a few instructions on the packed words, for example for the NaN part: ``` anyNan = (((a & 0x7fff7fff) + 0x03ff03ff) | ((b & 0x7fff7fff) + 0x03ff03ff) | ((c & 0x7fff7fff) + 0x03ff03ff) | ((r & 0x7fff7fff) + 0x03ff03ff)) & 0x80008000 ``` A 15-bit magnitude above `0x7c00` sets bit 15 of its half, and no carry crosses into the other half. 3. **Slow path.** If the guard is set, run today's rule code unchanged, in a branch: `if (guard) { result = rules(result) }`. A thread whose inputs and result are ordinary numbers never runs it. **Why the result is bit-identical:** the rules return the fast-path result unchanged whenever the guard is clear. The rule code is today's code, so the existing hardware-oracle tests cover it, and #3531's differential test already generates NaN, infinity, denormal and overflow inputs on every lane. **Expected cost per packed instruction:** the arithmetic plus about 10 guard instructions, instead of 100–227 IR values today. Most of the upper-bound gain above should remain; the prototype will measure how much. ### Pros - **Exact.** It adds no new assumption about hardware or drivers, unlike approximations or dropping rules behind a setting. - **Large and general saving.** Palworld is an Unreal Engine title, and any title whose shaders are compiled with 16-bit types runs these instructions. Its title screen alone would gain up to 22% frame rate. In other scenes and titles, the saving scales with how much of the frame is f16 math. - **The same pattern applies beyond packed math:** - scalar f16 min3/max3/min/max, about 60–100 IR values each and 1924 instructions in the same two shaders; - scalar `v_fma_f16`, `v_rcp_f16`; - the f32 NaN rules in `nanResultF32`. - **Complements the native-math PRs** (#3531, `OpFmaKHR`). Those remove the arithmetic cost; this removes most of what they leave. - **Small to review.** The rule code moves into a branch and isn't rewritten. ### Cons and mitigations - **Divergence.** - **Risk:** if one thread of a wave has a NaN, that wave runs both paths and costs today's price plus the guard. - **Mitigation:** NaN and infinity are rare in rendering math, and usually a bug in the title when they occur. Even in the worst case, a wave with NaNs on every instruction, the cost only rises by the guard, about 10 instructions per packed instruction. The prototype will count how often the guard fires in Palworld, so this is measured, not assumed. - **Control flow inside a translated block.** - **Risk:** the translator creates one IR block per RDNA block. - **Mitigation:** the slow path contains no subgroup operations, derivatives, memory accesses or image sampling, so its position doesn't matter for wave or quad semantics, and execution reconverges at the merge before the next instruction. The SPIR-V backend already emits branches with an `OpPhi` inside one IR instruction (`SpirvBdaRead.cpp`, `SpirvImageEmitter.cpp`), so the branch can live entirely in the backend. - **Code size and compile time.** - **Risk:** the module gains the guard and a branch per instruction, so SPIR-V size and driver compile time change. - **Mitigation:** the slow path is the code emitted today. The prototype will report SPIR-V words and pipeline compile time. - **Register pressure.** - **Risk:** the driver allocates registers for the largest path, so occupancy may not improve. - **Mitigation:** the saving comes from instructions not executed, not from occupancy. The upper-bound measurement shows that saving. - **One title, one GPU.** - **Risk:** the numbers come from one scene on one NVIDIA GPU. - **Mitigation:** the prototype PR will repeat #3531's per-instruction chain timing on at least NVIDIA and lavapipe, and the Palworld scene measurement. ### Implementation options 1. **A backend lowering.** One IR opcode per rule family, carrying the operand bits, the fast result and the mode flags as immediates. The SPIR-V backend emits the guard, the branch and the existing rule code. This keeps the IR straight-line, and the branch stays where the backend already makes branches. **I'd start here.** 2. **A generic "rare select".** The IR marks `Select(cond, fast, slow)` as rarely taken, and the backend sinks the values used only by `slow` into a branch. This is more general, so the f32 rules would come for free, but it's a larger change to the backend. 3. **Splitting the translated block.** A conditional block inside the translation. This touches the translator's block model, and I would avoid it. ### Plan 1. A prototype PR for packed add, mul and fma with option 1, including: - a differential test against the current rules on the NaN, infinity and overflow rows #3531 generates; - a test that forces every lane through the slow path; - a counter of how often the guard fires, behind a profiling variable; - #3531-style chain timings and the Palworld measurement. 2. If accepted, packed min/max, then the scalar f16 instructions. ### Questions - Is option 1 acceptable, or would you rather have the generic option 2? - Is per-thread control flow inside an instruction acceptable for the recompiler's exactness rules, given that the rule code itself does not change? AI-assisted (Claude Code)
queeeef commented 2026-10-11 22:43:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-11T22:43:38Z.


The OpFmaKHR follow-up mentioned above is #4072. In an A/B on the same scene, it takes about 2 ms per frame off one of the two shaders and leaves the other unchanged. Most of what remains in both is the special-value rules this proposal is about.

AI-assisted (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114727157 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6114727157). Originally posted by [queeeef](https://github.com/queeeef) on 2026-10-11T22:43:38Z. --- The `OpFmaKHR` follow-up mentioned above is #4072. In an A/B on the same scene, it takes about 2 ms per frame off one of the two shaders and leaves the other unchanged. Most of what remains in both is the special-value rules this proposal is about. AI-assisted (Claude Code)
oneandonlydean commented 2026-10-11 23:28:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:28:41Z.


Option 1 is fine as long as the output stays bit-identical: the rule code is unchanged and only reached less often. The PR needs the before/after for that change alone (#218) and the test that forces every lane through the slow path.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115110267 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6115110267). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:28:41Z. --- Option 1 is fine as long as the output stays bit-identical: the rule code is unchanged and only reached less often. The PR needs the before/after for that change alone (#218) and the test that forces every lane through the slow path.
MarcZX10 commented 2026-10-12 04:13:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T04:13:40Z.


Are you planning to prototype the option 1 backend lowering? If not, would you welcome another contributor carrying it forward, including the bit-identical slow-path test and before/after measurements requested above?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117620270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6117620270). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T04:13:40Z. --- Are you planning to prototype the option 1 backend lowering? If not, would you welcome another contributor carrying it forward, including the bit-identical slow-path test and before/after measurements requested above?
MarcZX10 commented 2026-10-12 06:42:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T06:42:17Z.


I checked the current test setup: the existing packed ALU, f16 FMA and FP16 overflow execution tests build and pass under lavapipe (3/3), so I can add an all-lanes slow-path differential case here. This environment has no hardware GPU or Palworld capture, so I cannot supply the requested Palworld before/after measurement. Are you planning to provide that benchmark, or would you prefer the prototype wait until someone with the title/GPU setup can measure it?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119150860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6119150860). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T06:42:17Z. --- I checked the current test setup: the existing packed ALU, f16 FMA and FP16 overflow execution tests build and pass under lavapipe (3/3), so I can add an all-lanes slow-path differential case here. This environment has no hardware GPU or Palworld capture, so I cannot supply the requested Palworld before/after measurement. Are you planning to provide that benchmark, or would you prefer the prototype wait until someone with the title/GPU setup can measure it?
queeeef commented 2026-10-12 13:39:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-12T13:39:34Z.


@MarcZX100 Go ahead, thanks. I'll provide the Palworld measurement.

  • Setup: PPSA23126 title screen, RTX 2080 Ti (NVIDIA 610.74), Windows 11. Builds with and without the change on the same base.
  • What I'll report: GPU time per frame for the two shaders in the table above (APS5_PROFILE_GPU), plus presents per 10 s. The frame rate varies more between runs than these changes do, so runs alternate with and without.
  • Also: on request, a count of how often the guard sends a lane to the slow path in that scene, if the prototype has a counter for it.

Ping me when there's a branch.

Two things that touch the same code:

  • #4072 computes v_pk_fma_f16 and v_pk_fmac_f16 with OpFmaKHR, and leaves the NaN, FP16_OVFL and clamp rules on its result bits unchanged. The guard should cover that native fma path too, so both fma paths reach the rules the same way.
  • #4011 (karanvora2599) skips the NaN rebuild for operands that are only compared, in the same packed f16 code.

I had only started a local sketch of option 2, so there's nothing to hand over.

AI-assisted (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125438313 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6125438313). Originally posted by [queeeef](https://github.com/queeeef) on 2026-10-12T13:39:34Z. --- @MarcZX100 Go ahead, thanks. I'll provide the Palworld measurement. - **Setup:** PPSA23126 title screen, RTX 2080 Ti (NVIDIA 610.74), Windows 11. Builds with and without the change on the same base. - **What I'll report:** GPU time per frame for the two shaders in the table above (`APS5_PROFILE_GPU`), plus presents per 10 s. The frame rate varies more between runs than these changes do, so runs alternate with and without. - **Also:** on request, a count of how often the guard sends a lane to the slow path in that scene, if the prototype has a counter for it. Ping me when there's a branch. Two things that touch the same code: - **#4072** computes `v_pk_fma_f16` and `v_pk_fmac_f16` with `OpFmaKHR`, and leaves the NaN, `FP16_OVFL` and clamp rules on its result bits unchanged. The guard should cover that native fma path too, so both fma paths reach the rules the same way. - **#4011** (karanvora2599) skips the NaN rebuild for operands that are only compared, in the same packed f16 code. I had only started a local sketch of option 2, so there's nothing to hand over. AI-assisted (Claude Code)
MarcZX10 commented 2026-10-12 20:27:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T20:27:35Z.


The first reviewable branch is ready: codex/f16-special-rules-4042-current, based on current upstream 825620ae5.

It adds a guarded packed-f16 special-value repair path and an all-lanes differential case against the existing rule expansion. On Linux with lavapipe, the Release build succeeded and these focused tests passed: agc_driver_packed_float16_native, agc_driver_packed_alu, agc_driver_float16_fma_rounding, and agc_driver_fp16_overflow. tools/check_conventions.py --base upstream/main and git diff --check pass.

Could you run the proposed alternating Palworld A/B on this branch against its base and share the two shader GPU times plus presents/10 s? The code does not add a slow-path counter yet. I’m coordinating the overlapping #4072 FMA change before opening the PR; after its merge/rebase I’ll rerun the same checks on the final stack.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132050991 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6132050991). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T20:27:35Z. --- The first reviewable branch is ready: [`codex/f16-special-rules-4042-current`](https://github.com/MarcZX100/AnyPS5/tree/codex/f16-special-rules-4042-current), based on current upstream `825620ae5`. It adds a guarded packed-f16 special-value repair path and an all-lanes differential case against the existing rule expansion. On Linux with lavapipe, the Release build succeeded and these focused tests passed: `agc_driver_packed_float16_native`, `agc_driver_packed_alu`, `agc_driver_float16_fma_rounding`, and `agc_driver_fp16_overflow`. `tools/check_conventions.py --base upstream/main` and `git diff --check` pass. Could you run the proposed alternating Palworld A/B on this branch against its base and share the two shader GPU times plus presents/10 s? The code does not add a slow-path counter yet. I’m coordinating the overlapping #4072 FMA change before opening the PR; after its merge/rebase I’ll rerun the same checks on the final stack.
MarcZX10 commented 2026-10-13 10:22:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T10:22:34Z.


Following up on the alternating Palworld A/B you offered: #5057 is now open at 68ee4015b567953f98866d1433a2121717031b49 with the guarded repair path and all-lanes differential test. Could you run the proposed comparison against its base and share the two shader GPU times plus presents per 10 s? This head retains the current f32 FMA lowering; #4072 remains a separate open change, so the result would measure this guard alone. No hardware-GPU performance claim is made until then.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143445219 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6143445219). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T10:22:34Z. --- Following up on the alternating Palworld A/B you offered: [#5057](https://github.com/boykopovar/AnyPS5/pull/5057) is now open at `68ee4015b567953f98866d1433a2121717031b49` with the guarded repair path and all-lanes differential test. Could you run the proposed comparison against its base and share the two shader GPU times plus presents per 10 s? This head retains the current f32 FMA lowering; #4072 remains a separate open change, so the result would measure this guard alone. No hardware-GPU performance claim is made until then.
MarcZX10 commented 2026-10-22 00:04:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:04:23Z.


Closing the loop on option 1: #5057 implemented the guarded path and an all-lanes differential test. The reported alternating Palworld A/B showed no measurable improvement in that scene, while shader 1 grew by about 17% in SPIR-V; the PR was closed pending evidence of a repeatable gain. The separate operand-reuse direction did land as #5811 (merged as 066b58f), reducing duplicate op_sel repacking without changing the repair rules. #5057 does not establish a general performance gain. A future guard proposal would need a workload showing a repeatable win and accounting for pipeline creation cost.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329337372 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4042#issuecomment-6329337372). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T00:04:23Z. --- Closing the loop on option 1: #5057 implemented the guarded path and an all-lanes differential test. The reported alternating Palworld A/B showed no measurable improvement in that scene, while shader 1 grew by about 17% in SPIR-V; the PR was closed pending evidence of a repeatable gain. The separate operand-reuse direction did land as #5811 (merged as `066b58f`), reducing duplicate `op_sel` repacking without changing the repair rules. #5057 does not establish a general performance gain. A future guard proposal would need a workload showing a repeatable win and accounting for pipeline creation cost. AI-assisted: yes.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#4042
No description provided.