Skip to content

editor: make stepped float lattices contraction-independent (#4900) - #4905

Merged
jakildev merged 3 commits into
masterfrom
claude/4900-stable-float-lattice
Nov 5, 2026
Merged

jakildev merged 3 commits into
masterfrom
claude/4900-stable-float-lattice

Conversation

@jakildev

@jakildev jakildev commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • reconstruct stepped FLOAT lattice points with an explicit single-rounding fused multiply-add
  • compile the production snap tests with FP contraction both enabled and disabled
  • cover non-binary defaults and explicit targets through module load, Builder, and the editor module session
  • document how module authors obtain exact non-binary lattice values

Test plan

  • fleet-build --target IrredenEngineTest — terminal fleet job succeeded
  • fleet-run IrredenEngineTest --gtest_filter='WidgetSliderSnapFpContract*:*SteppedFloat*' — 7/7 tests passed
  • positive control: replacing the fused reconstruction with k * step + min made the contraction-off test fail both rows by one float32 ULP
  • fleet-jobs start gui-verify -- IRVoxelEditor -- --module test/module --module-session test_recipe_float_step — 20/20 assertions passed and RESULT=CLEAN
  • fleet-build --target format-changed and fleet-build --target header-checks — clean
  • fleet-rules-sweep for direct standard-library math outside engine/math/ — 0 matches in 999 files
  • fleet-jobs start light-verify -- --if-changed — all checks passed and the terminal job exited 0

Acceptance evidence

Criterion Check run Observed
Contraction-independent canonical snap with a positive fire contraction-on/off source flags in build/test/CMakeFiles/IrredenEngineTest.dir/build.make; focused gtest; temporary mutation to the old expression Both final tests produced 0x3f333333 and 0x3f48f5c3 and were idempotent. The mutation made contraction-off produce 0x3f333334 and 0x3f48f5c4, so the check fires.
Non-binary module load plus omitted/default and explicit-target Builder application fleet-run IrredenEngineTest --gtest_filter='WidgetSliderSnapFpContract*:*SteppedFloat*' NonBinarySteppedFloatLoadsAndAppliesCanonicalTarget passed, recorded 0x3f333333, occupied the expected cell for both applications, emitted events, and finished without errors.
Linux and macOS parity for the canonical lattice focused gtest and macOS module-session GUI verifier macOS passed with canonical bits 0x3f333333; the module session reported explicit/default canonical values and 20/20 assertions. Linux is unverifiable on this macOS host and is delegated to Engine Tests CI.
Build, formatting, and static math checks final IrredenEngineTest fleet build; format-changed; header-checks; fleet-rules-sweep Build job 20261105T040636Z-build-efde2e succeeded, formatting and 787-header checks passed, and the math sweep found 0 matches.
Module-author documentation inspected creations/editors/voxel_editor/CLAUDE.md after formatting The Creation modules contract now states fused float32 reconstruction, the final clamp, binary-fraction behavior, and the full-precision nearest-value copy path for non-binary targets.

Notes for reviewer

Windows parity remains assumed rather than measured, matching the plan correction. The implementation is authored in the Codex runtime; no Claude authorship trailer is attached.

fleet-pr-overlap returned VERDICT: overlap. Its shared-path rows were:

Closes #4900

Route lattice reconstruction through an explicit fused multiply-add so all supported hosts round the final value once.

Cover both FP contraction modes, editor module loading, and default and explicit recipe application for non-binary steps.
@jakildev jakildev added fleet:wip Work in progress — not ready for review fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend and removed fleet:wip Work in progress — not ready for review labels Nov 5, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First-pass review — #4905 (stable FLOAT lattice via explicit FMA)

Verdict: needs-fix — one red CI validator the PR itself turns red; the code change is otherwise sound.

Big picture

The approach matches #4900: snapSliderValue reconstructs lattice point k as a single-rounding fma(k, step, min) instead of min + k * step, which the compiler may or may not contract per host/flags. Pinning the rounding explicitly removes the Linux/macOS/Windows divergence. Routing the call through a new IRMath::fusedMultiplyAdd (rather than a bare std::fma in widgets.hpp) respects the IRMath-wrapper rule, and <cmath> is already included in ir_math.hpp. All other consumers (recipeParamLatticeValue, system_widget_apply_slider.hpp) go through snapSliderValue, so one change covers the editor, Builder and slider paths. Recipe indices in the Lua binding test check out (non_binary_float is registered 8th → recipes_[7], size 8→9, matrix_column shifts to 8 and nothing indexes it by position).

Needs-fix

  1. instruction-size CI is red, caused by this PR. creations/editors/voxel_editor/CLAUDE.md is 210 lines on master (budget 200, inside the +10 band) and 214 on this head → 214 lines, budget 200 (+14, past the 10-line band) (run 41966102899). It is the only "introduced" offender; the other listed files are inherited. Fix by landing the new "Creation modules" sentence net-zero in lines: tighten the added 4-line passage to what a module author needs (fused float32 k * step + min, then clamp; non-binary targets → copy the error's nearest value) and/or trim ≥4 lines elsewhere in that file. Do not raise the baseline for this.

Nits (follow-up)

  • -ffp-contract=on is not implemented by GCC (docs: "currently treated equal to off"), so on the Linux gcc CI host …FpContractOnTest exercises the same mode as the Off test; =fast is the GCC spelling that actually permits contraction. Clang (macOS) is genuinely covered. The explicit fma makes the result mode-independent either way, so this only weakens the positive control on Linux, not correctness.
  • fusedMultiplyAdd falls back to a libm software fma on hosts without hardware FMA; fine for a non-hot snap path, just worth knowing if it is ever reused in a tick.
  • The "Windows parity assumed" note is acknowledged in the PR body; no action here.

Verified / not verified

  • Read the full diff and the call-site census (git grep of snapSliderValue/recipeParamLatticeValue): consistent.
  • I did not build or run the tests; the author's bit-pattern evidence (0x3f333333, 0x3f48f5c3) and mutation positive control are plausible against the diff. linux-build and perf-gate were still pending at review time.

Reviewed by Claude (pool-6, sonnet first pass).

Opus recheck required: touches engine/math/include/irreden/ir_math.hpp (public math header, core path) and changes a float-determinism contract.

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:reviewing-mac-pool-6 labels Nov 5, 2026
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:needs-fix Fleet reviewer found issues — author must address fleet:amending-mac-pool-5 labels Nov 5, 2026
@jakildev

jakildev commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • Confirmed commit 927f29bc already compresses the Creation modules guidance from seven lines to three, leaving creations/editors/voxel_editor/CLAUDE.md at 210 lines—the same count as origin/master.
  • Re-ran python3 scripts/lint_instruction_size.py --against origin/master --warn-band 10; it reports no introduced offenders and classifies the editor instructions as inherited, not worsened.
  • Confirmed the current-head instruction-size check is green. The cited red run predates the size-fix commit, although the review was submitted against that commit.

No additional source change or push was needed; the requested fix is already present on the reviewed head. — worker (Codex)

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — #4905 (stable FLOAT lattice via explicit FMA)

Verdict: approve — the one prior needs-fix is resolved at 927f29bc3; no new findings.

Prior-review resolution

  • ✅ creations/editors/voxel_editor/CLAUDE.md — instruction-size red (214 lines vs 200 budget, +14 past the band) — verified fixed at 927f29bc3: the file is 210 lines on both this head and origin/master (net-zero; the 4-line passage was folded into the existing bullet plus two short lines), and the instruction-size check is pass on the current head (run 41966319118). The red run cited in the first review predates the size-fix commit.
  • ↗ nit (-ffp-contract=on is treated as off by GCC, so the Linux …FpContractOnTest exercises the same mode as …Off) — still present, wording-tier, carried below as a follow-up; correctness is unaffected because the explicit fma is mode-independent.

Big picture

Matches #4900: snapSliderValue now reconstructs lattice point k as a single-rounding IRMath::fusedMultiplyAdd(k, step, min) followed by the existing range clamp, so Apple clang's default contraction and GCC's non-contraction agree bit for bit. The fused helper lives in IRMath (<cmath> already included at ir_math.hpp:18), keeping std::fma out of the prefab header. All lattice consumers (recipeParamLatticeValue, Builder admission, slider apply) go through snapSliderValue, so one change covers the editor, Builder and slider paths.

Acceptance (issue #4900), checked against the diff:

  • Contraction-independent snap, stated at the call site, with the two table rows pinned as bit patterns (0x3f333333, 0x3f48f5c3) plus an idempotence check, compiled under -ffp-contract=on and off as two translation units sharing one case header — met (author's mutation positive control makes the Off row fail by 1 ULP).
  • Non-binary test/module param (canonical: min 0.4, step 0.025, default 0.7) and NonBinarySteppedFloatLoadsAndAppliesCanonicalTarget covering omitted/default and explicit-lattice Builder applications; recipe index recipes_[7] and the 8→9 size updates are consistent — met on macOS per the author's evidence; the Linux side rides Engine Tests CI.
  • CLAUDE.md §Creation modules states the fused rule, the clamp, binary-fraction exactness and the copy-nearest path — met.

Nits (follow-up)

  • test/CMakeLists.txt: GCC does not implement -ffp-contract=on (treated as off); =fast is the spelling that permits contraction there. Clang/macOS genuinely covers both modes; on the Linux gcc host the positive control is weaker, not the result.
  • fusedMultiplyAdd falls back to a libm software fma on hardware without FMA; fine for a non-hot snap path, worth knowing before reuse in a tick.

Verified / not verified

  • Read the full diff and the surrounding files at 927f29bc3; confirmed CLAUDE.md line counts (210 here, 210 on master) and the check rollup. Passing: instruction-size, format-check, header-checks, comment-refs, closes-lint, whitespace, no-plan-files.
  • Not run by me: build and gtests. linux-build and perf-gate were still pending on this head at review time — unread, not green. The author's bit-pattern and GUI-verify evidence is plausible against the diff.
  • Windows parity is assumed, per the issue's plan correction.

Reviewed by Claude (pool-5, sonnet first pass).

Opus recheck required: adds a public helper to engine/math/include/irreden/ir_math.hpp (core math header) and changes a cross-platform float-determinism contract; also linux-build was still pending so the Linux/GCC behavior is unconfirmed.

@jakildev jakildev added fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-5 labels Nov 5, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opus recheck — #4905 (stable FLOAT lattice via explicit FMA)

Verdict: needs-fix. The production fix is correct. The test meant to prove contraction independence doesn't run the contraction-enabled build, so the #4900 acceptance criterion it backs is unmet in substance.

Needs-fix

  1. WidgetSliderSnapFpContractOnTest runs the code compiled with -ffp-contract=off, so the "on" mode never executes. IRTest::detail::expectCanonicalSteppedFloatLattices() (test/render/widget_slider_snap_test_cases.hpp:163) is an inline function with external linkage. Each of the two TUs emits it out of line as a weak COMDAT, and each TestBody only tail-branches to it. The linker keeps one copy. Measured on the macOS build of this head (pool-3/build, built 20:06–20:07, objects carry -ffp-contract=off / =on per flags.make):

    • Each object holds the helper as a weak external (nm -m: weak external automatically hidden IRTest::detail::expectCanonicalSteppedFloatLattices() in both …_off_test.cpp.o and …_on_test.cpp.o), and snapSliderValue is inlined into it.
    • The linked IrredenEngineTest holds one copy, at 0x1007c9110, directly after the Off TestBody. Both WidgetSliderSnapFpContractOffTest_…::TestBody() and WidgetSliderSnapFpContractOnTest_…::TestBody() disassemble to b IRTest::detail::expectCanonicalSteppedFloatLattices(), i.e. the same address.

    So on macOS, the only host where on actually contracts (GCC < 14 treats on as off, and x86-64 has no FMA without -mfma), the "on" test re-runs the off machine code. The plan says "both modes must execute the production helper" (#4900 plan, Locked decisions), and the criterion asks for both modes to report the bits. Neither holds yet. This also explains the positive control: the k * step + min mutation would have failed both tests. Real two-mode coverage would show On passing (clang fuses) and Off failing.

    Fix: give the case helper internal linkage so each TU keeps its own copy, e.g. static void expectCanonicalSteppedFloatLattices() in the header (no anonymous namespace in a header, per the naming rule), or the body inline in each .cpp. Evidence to attach: nm IrredenEngineTest | c++filt | grep expectCanonicalSteppedFloatLattices shows two local (t) copies, and a re-run of the mutation positive control on macOS shows the differential: …On… passes and …Off… fails by one ULP on both rows. That differential is the only observation that proves both modes ran. snapSliderValue stays inline-external, but it's inlined into the helper here because IrredenEngine exports -O3 publicly (engine/CMakeLists.txt:67-71). The differential mutation run is what catches it if that ever changes.

Sonnet's points, rechecked

  • Sonnet flagged the core math header and the determinism contract. On closer read I confirm the production change is sound. Every non-fused step of snapSliderValue is contraction-free: clamp, (clamped - min) / step, floor(steps + 0.5f), the final clamp. The only multiply-add is now explicit std::fma, which C++ requires to round once on every conforming host. Callers: recipeParamLatticeValue (recipes_panel.hpp:56) feeds editor_lua_host.hpp:330,579, main.cpp:3028,3476 and session_builder.hpp:1283-1285, and system_widget_apply_slider.hpp:131 goes through the slider overload. All of them now share one canonical value. session_builder.hpp:1282's halfStep = 0.49f * step is a separate statement, so clang's on mode can't fuse it with the value ± halfStep that follows. No -ffast-math / -ffp-contract exists anywhere in the build except the two new test options.
  • Sonnet's GCC -ffp-contract=on nit: I confirm it, and it's moot once the item above is fixed. macOS clang is the only host where the On TU differs, which is what #4900's criterion names ("on macOS").
  • Hot path: system_widget_apply_slider snaps once per slider gesture update. std::fma is one fmadd on arm64 (both objects show it). On x86-64 glibc it's an IFUNC-dispatched fmaf. Negligible either way.
  • Recipe indices: rechecked. non_binary_float is the 8th registration → recipes_[7]. matrix_column moves to 8 and nothing indexes it by position. Sizes 8→9 are consistent. test_ratio's new canonical param is used only by test_recipe_float_step, so no other module session's panel layout moves.

Not verified

  • I didn't rebuild or run tests. The findings above come from the existing macOS build objects and linked binary of this head.
  • linux-build and perf-gate are still pending on 927f29bc3, so they aren't green.
  • Windows (mingw-w64 fmaf rounding) is assumed, per the plan correction.

Reviewed by Claude (pool-5, opus recheck).

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge fleet:reviewing-mac-pool-5 labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-9v74-80-unknown

perf comparison: 86f9930 → b181fbd-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-9v74-80-unknown/86f9930422e5a0af7df205c95cdc3daf4bfb176d
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/b181fbdea-ci

host calibration

  • host: linux-x86_64-epyc-9v74-80-unknown (matches baseline)
  • ref_ms: head 90.46 vs baseline 89.89 (load_factor 1.01×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@86f993042 (branch tip); master 4e8e10656, finished 2026-11-04T06:07:04Z, 0.9 d before the head run, ref_ms 89.89
  • weighting: raw (class-matched capture; load_factor 1.01×; no calibration-scaling entry)
  • attribution: no measured master improvement between capture master 4e8e10656 and merge base 463814f2a (9 commits)

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.788 → 0.788 (+0.0pp) 156630 → 156630 262144 → 262144 50080 → 50080 (1.000×)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 381.40 → 381.82 (+0.1%) 1381.95 → 1378.45 (-0.3%)
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 929.41 → 925.79 (-0.4%) 1965.42 → 1965.51 (+0.0%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 474.31 → 493.46 (+4.0%) 6965.55 → 7341.61 (+5.4%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1228.08 → 1231.43 (+0.3%) 2225.22 → 2229.18 (+0.2%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 47.10→47.01 47.78→47.18 43.78→43.45 0.80→0.76 41.57→42.00 4.59→4.72 — 0.00→0.00 2.31→2.34 11.45→11.68 16.53→16.26 15.09→15.31 3.10→3.19 1.01→1.03 0.16→0.17 — 6.19→6.29
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 85.34→85.38 291.09→290.56 179.95→179.64 2.85→2.84 161.64→159.83 4.11→4.25 — 0.00→0.00 2.01→1.99 20.87→21.48 15.52→15.65 12.89→12.86 6.43→6.40 1.16→1.16 0.16→0.15 ↓ — 5.98→5.80
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 41.97→43.82 56.36→58.14 47.96→49.30 7.12→7.11 37.40→38.99 6.11→6.44 0.73→0.77 0.00→0.00 0.74→0.82 ⚠ 36.31→38.26 15.72→16.90 31.38→32.80 5.22→5.33 1.36→1.43 0.15→0.16 0.00→0.00 7.04→7.14
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 90.93→91.22 359.64→358.40 291.30→291.66 4.42→4.41 252.25→252.30 4.75→4.83 0.72→0.75 0.00→0.00 0.58→0.61 18.12→18.35 15.17→15.91 12.76→12.90 5.17→5.24 1.06→1.23 ⚠ 0.14→0.15 0.00→0.00 5.82→5.86

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 188.937 → 188.452 (-0.3%)
RENDER ComputeLightVolume 31.221 → 31.198 (-0.1%)
RENDER CanvasToFramebuffer 14.711 → 14.837 (+0.9%)
RENDER BakeSunShadowMap 7.619 → 7.660 (+0.5%)
RENDER ComputeSunShadow 6.055 → 6.271 (+3.6%)
UPDATE PropagateTransform 4.086 → 4.109 (+0.6%)
RENDER LightingToTrixel 3.217 → 3.307 (+2.8%)
UPDATE FogRevealEval 3.138 → 3.150 (+0.4%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 725.733 → 723.718 (-0.3%)
RENDER ComputeLightVolume 28.029 → 28.162 (+0.5%)
RENDER ComputeSunShadow 16.282 → 16.741 (+2.8%)
RENDER CanvasToFramebuffer 13.661 → 13.923 (+1.9%)
RENDER BakeSunShadowMap 6.553 → 6.739 (+2.8%)
RENDER LightingToTrixel 6.591 → 6.584 (-0.1%)
RENDER ComputeVoxelAO 5.931 → 5.674 (-4.3%)
UPDATE PropagateTransform 3.929 → 3.776 (-3.9%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 205.614 → 216.281 (+5.2%)
RENDER ComputeSunShadow 31.302 → 32.805 (+4.8%)
RENDER ComputeLightVolume 29.635 → 31.556 (+6.5%)
RENDER LightingToTrixel 18.552 → 19.248 (+3.8%)
RENDER CanvasToFramebuffer 14.825 → 15.169 (+2.3%)
RENDER BakeSunShadowMap 9.739 → 10.363 (+6.4%)
UPDATE PropagateTransform 5.308 → 5.334 (+0.5%)
RENDER FogToTrixel 4.535 → 4.642 (+2.4%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1005.282 → 1005.041 (-0.0%)
RENDER ComputeLightVolume 27.581 → 28.445 (+3.1%)
RENDER ComputeSunShadow 13.567 → 13.808 (+1.8%)
RENDER CanvasToFramebuffer 13.730 → 13.761 (+0.2%)
RENDER BakeSunShadowMap 6.541 → 6.494 (-0.7%)
RENDER LightingToTrixel 5.340 → 5.393 (+1.0%)
UPDATE PropagateTransform 5.260 → 5.250 (-0.2%)
RENDER ComputeVoxelAO 4.776 → 4.851 (+1.6%)

@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-7763-64-unknown

perf comparison: 0dd14fe → 10fc2ca-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-7763-64-unknown/0dd14fe5f843e1e3b9fd93008c70a16a044d0968
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/10fc2caf5-ci

host calibration

  • host: linux-x86_64-epyc-7763-64-unknown (matches baseline)
  • ref_ms: head 104.35 vs baseline 103.59 (load_factor 1.01×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@0dd14fe5f (branch tip); master b79eee32d, finished 2026-11-05T03:09:47Z, 0.0 d before the head run, ref_ms 103.59
  • weighting: raw (class-matched capture; load_factor 1.01×; no calibration-scaling entry)
  • attribution: no measured master improvement between capture master b79eee32d and merge base 463814f2a (1 commits)

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.788 → 0.788 (+0.0pp) 156630 → 156630 262144 → 262144 50080 → 50080 (1.000×)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 499.40 → 501.30 (+0.4%) 1760.90 → 1828.28 (+3.8%)
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 1287.90 → 1288.54 (+0.0%) 2594.09 → 2648.33 (+2.1%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 659.37 → 681.45 (+3.3%) 12389.98 → 13395.71 (+8.1%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1740.47 → 1742.36 (+0.1%) 3053.93 → 3004.42 (-1.6%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 68.13→66.88 66.88→66.45 59.05→58.83 0.98→0.99 55.28→55.38 5.76→5.69 — 0.00→0.00 2.85→2.74 15.82→15.71 11.85→12.07 22.81→22.89 4.05→4.00 1.30→1.31 0.20→0.21 — 8.07→8.12
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 111.21→110.34 415.85→417.05 263.75→262.76 4.06→4.12 234.79→233.36 5.07→5.18 — 0.00→0.00 2.43→2.43 28.85→28.56 10.35→10.71 19.23→19.67 8.56→8.47 1.74→1.65 ↓ 0.19→0.19 — 7.57→7.60
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 58.83→59.52 81.20→82.69 66.44→67.57 12.84→13.83 47.94→48.22 8.96→8.92 1.13→1.15 0.00→0.00 0.91→0.98 62.49→68.55 10.48→10.70 57.33→60.48 7.95→8.31 1.81→1.86 0.17→0.20 ⚠ 0.00→0.00 9.05→9.37
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 119.72→120.98 539.05→534.98 427.26→426.61 6.38→6.38 366.88→367.52 5.73→5.72 1.14→1.13 0.00→0.00 0.78→0.90 ⚠ 25.19→25.85 10.49→10.38 19.40→19.32 6.55→6.84 1.57→1.66 0.18→0.20 ⚠ 0.00→0.00 7.46→7.67

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 258.205 → 256.283 (-0.7%)
RENDER ComputeLightVolume 34.149 → 34.474 (+1.0%)
RENDER CanvasToFramebuffer 17.800 → 17.744 (-0.3%)
RENDER BakeSunShadowMap 10.418 → 10.223 (-1.9%)
RENDER ComputeSunShadow 8.107 → 8.123 (+0.2%)
UPDATE PropagateTransform 4.805 → 4.832 (+0.6%)
UPDATE FogRevealEval 4.286 → 4.490 (+4.8%)
RENDER LightingToTrixel 4.197 → 4.173 (-0.6%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1032.022 → 1030.377 (-0.2%)
RENDER ComputeLightVolume 29.065 → 29.869 (+2.8%)
RENDER ComputeSunShadow 22.141 → 22.070 (-0.3%)
RENDER CanvasToFramebuffer 16.550 → 16.358 (-1.2%)
RENDER ComputeVoxelAO 9.643 → 9.477 (-1.7%)
RENDER BakeSunShadowMap 9.093 → 8.873 (-2.4%)
RENDER LightingToTrixel 8.765 → 8.679 (-1.0%)
UPDATE PropagateTransform 4.763 → 4.808 (+0.9%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 289.372 → 297.404 (+2.8%)
RENDER ComputeSunShadow 55.321 → 61.181 (+10.6%) ⚠
RENDER LightingToTrixel 36.045 → 39.359 (+9.2%)
RENDER ComputeLightVolume 32.823 → 32.861 (+0.1%)
RENDER BakeSunShadowMap 22.611 → 23.355 (+3.3%)
RENDER CanvasToFramebuffer 17.555 → 17.759 (+1.2%)
RENDER FogToTrixel 7.071 → 7.388 (+4.5%)
UPDATE PropagateTransform 6.047 → 6.217 (+2.8%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1464.334 → 1461.392 (-0.2%)
RENDER ComputeLightVolume 29.522 → 29.200 (-1.1%)
RENDER ComputeSunShadow 18.700 → 19.246 (+2.9%)
RENDER CanvasToFramebuffer 16.419 → 16.678 (+1.6%)
RENDER BakeSunShadowMap 8.826 → 9.010 (+2.1%)
RENDER ComputeVoxelAO 7.817 → 7.961 (+1.8%)
RENDER LightingToTrixel 6.778 → 7.021 (+3.6%)
UPDATE PropagateTransform 6.172 → 6.213 (+0.7%)

@jakildev

jakildev commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Addressed the Opus recheck at b20d2de:

  • Made expectCanonicalSteppedFloatLattices translation-unit local with static linkage, preventing COMDAT selection between the On and Off test TUs.
  • Rebuilt IrredenEngineTest and temporarily restored the non-fused k * step + min reconstruction. The corrected differential is now observed: WidgetSliderSnapFpContractOnTest passes; WidgetSliderSnapFpContractOffTest fails both table rows by one ULP (1060320052 vs 1060320051 and 1061746116 vs 1061746115).
  • Restored the production FMA, rebuilt, and reran the focused suite: 7/7 pass, including both contraction modes and all stepped-float binding cases.
  • No standalone helper symbols remain in the optimized binary because each TU-local helper is fully inlined into its TestBody; the mutation differential directly proves the two separately compiled bodies execute.

The pushed head and origin both resolve to b20d2de, and the PR was re-stamped for runtime codex after the push. — worker (Codex)

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-9v74-80-unknown

perf comparison: 361c316 → 02e1fb5-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-9v74-80-unknown/361c3161e7bca8fca557bcacfd514bc981515641
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/02e1fb5be-ci

host calibration

  • host: linux-x86_64-epyc-9v74-80-unknown (matches baseline)
  • ref_ms: head 90.37 vs baseline 89.92 (load_factor 1.01×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@361c3161e (branch tip); master 23b4d0e72, finished 2026-11-05T04:28:51Z, 0.0 d before the head run, ref_ms 89.92
  • weighting: raw (class-matched capture; load_factor 1.01×; no calibration-scaling entry)
  • attribution: no measured master improvement between capture master 23b4d0e72 and merge base 23b4d0e72 (0 commits)

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.788 → 0.788 (+0.0pp) 156630 → 156630 262144 → 262144 50080 → 50080 (1.000×)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 386.70 → 384.05 (-0.7%) 1395.41 → 1382.17 (-0.9%)
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 934.70 → 928.53 (-0.7%) 1986.96 → 1983.68 (-0.2%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 490.07 → 496.94 (+1.4%) 7535.31 → 7981.27 (+5.9%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1241.41 → 1240.30 (-0.1%) 2281.99 → 2242.09 (-1.7%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 47.45→47.08 47.93→47.92 43.84→43.98 0.78→0.78 41.93→42.23 4.85→4.67 — 0.00→0.00 2.36→2.32 12.00→12.10 17.25→16.48 15.28→15.11 3.39→3.22 ↓ 1.02→1.01 0.18→0.18 — 6.38→6.25
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 85.83→85.34 292.62→292.73 179.65→179.78 2.85→2.83 160.75→160.04 4.21→4.44 — 0.00→0.00 2.02→2.00 21.38→21.38 16.06→15.57 12.99→12.79 6.62→6.56 1.16→1.20 0.17→0.15 ↓ — 6.00→5.88
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 41.76→42.22 57.28→57.27 48.10→48.18 7.36→7.44 37.60→37.54 6.33→12.88 ⚠ 0.75→0.74 0.00→0.00 0.84→0.85 38.83→38.84 15.95→16.09 32.33→32.41 5.32→5.35 1.40→1.41 0.16→0.16 0.00→0.00 7.13→7.00
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 91.69→91.33 361.67→360.44 292.01→291.51 4.45→4.43 253.53→252.93 5.00→5.00 0.74→0.74 0.00→0.00 0.68→0.61 ↓ 19.09→18.51 16.04→16.27 12.98→13.00 5.41→5.47 1.15→1.14 0.17→0.15 ↓ 0.00→0.00 5.96→5.84

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 190.085 → 190.056 (-0.0%)
RENDER ComputeLightVolume 32.117 → 31.170 (-2.9%)
RENDER CanvasToFramebuffer 15.199 → 14.880 (-2.1%)
RENDER BakeSunShadowMap 7.727 → 7.757 (+0.4%)
RENDER ComputeSunShadow 6.533 → 6.554 (+0.3%)
UPDATE PropagateTransform 3.905 → 3.910 (+0.1%)
RENDER LightingToTrixel 3.516 → 3.362 (-4.4%)
UPDATE FogRevealEval 3.234 → 3.190 (-1.4%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 726.653 → 726.032 (-0.1%)
RENDER ComputeLightVolume 28.634 → 27.950 (-2.4%)
RENDER ComputeSunShadow 16.865 → 16.865 (+0.0%)
RENDER CanvasToFramebuffer 14.207 → 13.794 (-2.9%)
RENDER LightingToTrixel 6.802 → 6.741 (-0.9%)
RENDER BakeSunShadowMap 6.489 → 6.473 (-0.2%)
RENDER ComputeVoxelAO 5.799 → 5.737 (-1.1%)
UPDATE PropagateTransform 3.901 → 3.760 (-3.6%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 211.685 → 219.150 (+3.5%)
RENDER ComputeSunShadow 33.623 → 33.523 (-0.3%)
RENDER ComputeLightVolume 30.058 → 30.032 (-0.1%)
RENDER LightingToTrixel 19.377 → 19.615 (+1.2%)
RENDER CanvasToFramebuffer 14.929 → 14.694 (-1.6%)
RENDER BakeSunShadowMap 10.105 → 10.057 (-0.5%)
UPDATE PropagateTransform 5.317 → 5.351 (+0.6%)
RENDER FogToTrixel 4.569 → 4.608 (+0.9%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1010.205 → 1007.955 (-0.2%)
RENDER ComputeLightVolume 28.611 → 28.863 (+0.9%)
RENDER CanvasToFramebuffer 13.888 → 14.108 (+1.6%)
RENDER ComputeSunShadow 14.340 → 13.949 (-2.7%)
RENDER BakeSunShadowMap 6.758 → 6.553 (-3.0%)
RENDER LightingToTrixel 5.563 → 5.625 (+1.1%)
UPDATE PropagateTransform 5.236 → 5.256 (+0.4%)
RENDER ComputeVoxelAO 4.881 → 4.899 (+0.4%)

@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-4 labels Nov 5, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — #4905 (stable FLOAT lattice via explicit FMA)

Verdict: approve — the Opus recheck's one needs-fix is resolved at b20d2de8c; no new findings.

Prior-review resolution

  • ✅ test/render/widget_slider_snap_test_cases.hpp:13 — expectCanonicalSteppedFloatLattices() was inline with external linkage, so the linker folded the On/Off TUs' copies into one and the -ffp-contract=on test re-ran the off machine code — verified fixed at b20d2de8c: it is now static, so each TU keeps its own copy. The delta is exactly that one line (1+/1-); the only two users are widget_slider_snap_fp_contract_{off,on}_test.cpp:4, so there is no unused-function exposure.
  • ✅ Opus's requested evidence — the author's comment reports the corrected differential after the fix: …On… passes and …Off… fails both rows by one ULP (1060320052 vs 1060320051, 1061746116 vs 1061746115) under the temporary k * step + min mutation, and 7/7 pass with the production FMA restored. This is the observation that proves both modes executed, and it matches the structure the diff now has.
  • ↗ nit (GCC treats -ffp-contract=on as off) — unchanged, wording-tier, carried below.
  • ↗ nit (fusedMultiplyAdd software fallback without hardware FMA) — unchanged, carried below.

Big picture

Nothing else moved since the Opus recheck confirmed the production change (snapSliderValue → IRMath::fusedMultiplyAdd(k, step, min) then the final clamp). The fix is test-only and tightens exactly what the #4900 criterion asks for: both contraction modes now execute their own compiled body. Checks on the current head: closes-lint, comment-refs, format-check, header-checks, instruction-size, no-plan-files, whitespace, and perf-gate are pass. linux-build is pending on this head — unread, not green; it rides as the Linux/GCC leg of the criterion.

Nits (follow-up)

  • test/CMakeLists.txt:310: GCC does not implement -ffp-contract=on (treated as off); =fast is the spelling that permits contraction there. Clang/macOS genuinely covers both modes, so the Linux positive control is weaker, not the result.
  • fusedMultiplyAdd falls back to a libm software fma on hardware without FMA; fine for a non-hot snap path, worth knowing before reuse in a tick.
  • The differential only holds while snapSliderValue is inlined into the helper (the engine exports -O3 publicly); at -O0 the inline-external snapSliderValue would again fold to one COMDAT copy. Out of scope here; the mutation run is what catches it.

Verified / not verified

  • Read the delta commit and the full case header, both TU files, and the test/CMakeLists.txt option wiring at b20d2de8c.
  • Not run by me: build, gtests, or the mutation control. The differential is the author's reported observation, consistent with the diff.
  • Windows parity is assumed, per the issue's plan correction.

Escalation: none. Safe for merge.

🤖 Reviewed by Claude Sonnet (review-pr skill)

Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge fleet:has-nits PR is approved, but reviewer flagged optional improvements to address before merge fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:has-nits PR is approved, but reviewer flagged optional improvements to address before merge fleet:reviewing-mac-pool-1 labels Nov 5, 2026
@jakildev
jakildev merged commit f77113d into master Nov 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editor: a stepped FLOAT recipe param's lattice depends on FP contraction — a default that loads on macOS arm64 is a load error on x86-64 builds

1 participant