Skip to content

test(renderer): bloom + fog visual-evidence + CPU math contracts#389

Merged
drsnuggles8 merged 2 commits into
masterfrom
feature/bloom-fog-visual-evidence-tests
Jun 25, 2026
Merged

test(renderer): bloom + fog visual-evidence + CPU math contracts#389
drsnuggles8 merged 2 commits into
masterfrom
feature/bloom-fog-visual-evidence-tests

Conversation

@drsnuggles8

@drsnuggles8 drsnuggles8 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Tests
    • Added new automated checks for bloom and fog rendering math.
    • Added visual regression coverage for bloom and fog, including saved PNG evidence and pixel-level validation.
    • Expanded test coverage to verify rendering behavior stays consistent across near/far distances and bright/emissive scenes.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 282a36cd-e45e-42ca-8da0-3c480c6304cc

📥 Commits

Reviewing files that changed from the base of the PR and between 8622ccb and c69a2e8.

⛔ Files ignored due to path filters (4)
  • OloEditor/assets/tests/visual/Bloom_Off.png is excluded by !**/*.png
  • OloEditor/assets/tests/visual/Bloom_On.png is excluded by !**/*.png
  • OloEditor/assets/tests/visual/Fog_Off.png is excluded by !**/*.png
  • OloEditor/assets/tests/visual/Fog_On.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • OloEngine/tests/CMakeLists.txt
  • OloEngine/tests/Rendering/BloomMathTest.cpp
  • OloEngine/tests/Rendering/FogMathTest.cpp
  • OloEngine/tests/Rendering/PropertyTests/BloomVisualEvidenceTest.cpp
  • OloEngine/tests/Rendering/PropertyTests/FogVisualEvidenceTest.cpp

📝 Walkthrough

Walkthrough

Adds CMake entries for four rendering test sources and introduces CPU math tests plus visual evidence tests for Bloom and Fog. The visual tests render fixed scenes, capture RGBA8 output, write PNG evidence, reload it, and compare sampled pixel data.

Changes

Rendering post-process validation

Layer / File(s) Summary
CPU math contracts
OloEngine/tests/CMakeLists.txt, OloEngine/tests/Rendering/BloomMathTest.cpp, OloEngine/tests/Rendering/FogMathTest.cpp
Adds the new Bloom and Fog math test sources to the test target and covers extraction, compositing, fog factor, and UBO packing contracts.
Visual evidence tests
OloEngine/tests/CMakeLists.txt, OloEngine/tests/Rendering/PropertyTests/BloomVisualEvidenceTest.cpp, OloEngine/tests/Rendering/PropertyTests/FogVisualEvidenceTest.cpp
Adds the Bloom and Fog visual evidence tests, including fixed-scene capture, PNG round-trips, and sampled-region assertions.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@drsnuggles8

Copy link
Copy Markdown
Owner Author

🤖 Self-review (finish-pr) @ 30425139

Reviewed the full PR diff against master at high effort (≈1145 lines: 4 new test files + CMakeLists registration + 4 visual-evidence PNGs). This is a test-only, additive PR — no engine/shader/runtime code changes.

What I verified

  • Every CPU math mirror matches the real GLSL, line-for-line:
    • ExtractBrightPostProcess_BloomThreshold.glsl (incl. correctly noting the first bright = max(...) line is overwritten by the soft-knee expression).
    • CompositeBloomPostProcess_BloomComposite.glsl (scene + bloom*intensity).
    • ComputeDistanceFog / ComputeHeightFog / fog-factor clamp ↔ include/FogCommon.glsl (incl. the 1e-4 epsilon and the deltaH removable-singularity branch).
    • CompositeFog ↔ the analytical PostProcess_Fog.glsl inscatter/transmittance + PostProcess_FogUpsample.glsl composite (scene*(1-f) + fogColor*f).
  • Built OloEngine-Tests (Debug) locally and ran all 13 new tests → 13 PASSED, including the two GPU visual-evidence tests (they rendered, not skipped — real GL 4.6 context).
  • Inspected all four regenerated PNGs (Bloom_{Off,On}, Fog_{Off,On}): bloom shows a local green halo bleeding from the bright cube (not a frame-wide wash); fog shows near-clear→distant-blue gradient with the near floor not repainted. The freshly-rendered frames are byte-identical to the committed evidence (deterministic, mock-time frozen).

Findings: 1 (minor, non-blocking)

  • Fixed — a stream-of-consciousness comment in BloomMathTest.cpp ("…softness is (0.5)^2 wait —") was cleaned up to a precise statement of the gate-edge case. Conclusion the comment reached was already correct; only the committed prose was sloppy. Staged locally, pending an explicit push.

Dismissed: none.

CI is green across the board (Windows build, SonarCloud, all four sanitizers, pre-commit); PR is MERGEABLE with 0 unresolved review threads. CodeRabbit hit its review rate limit and never ran — there was no incoming review feedback to disposition.

@drsnuggles8 drsnuggles8 added the self-reviewed finish-pr self-review done label Jun 25, 2026
The SubThresholdPixelSuppressed comment had a stream-of-consciousness
correction left in ("...softness is (0.5)^2 wait —"). Replace it with a
precise statement of the gate-edge case (brightness = threshold - 0.5 →
softness = clamp(0,0,1)^2 = 0 → extracted value is exactly zero). No
behavioural change; comment-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@drsnuggles8

Copy link
Copy Markdown
Owner Author

🤖 Self-review (finish-pr) — re-stamp @ c69a2e81

Head moved from 30425139c69a2e81. The only delta is the comment-only cleanup reviewed above (clarify the bloom soft-knee gate-edge comment in BloomMathTest.cpp) — no behavioural change, no new code paths. The full review (math mirrors verified against GLSL, 13/13 tests passing incl. 2 GPU visual tests, all 4 PNG evidence images inspected) stands. Re-posting only to track the new HEAD.

Findings: 0 new. Mergeable, 0 unresolved review threads; CI will re-run on this push.

@drsnuggles8 drsnuggles8 merged commit 2ad66bb into master Jun 25, 2026
7 of 8 checks passed
@drsnuggles8 drsnuggles8 deleted the feature/bloom-fog-visual-evidence-tests branch June 25, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

self-reviewed finish-pr self-review done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant