Skip to content

Phase 1: Golden Image 回归测试 — Python CI 视觉回归检测 #54

Description

@Cle2ment

背景

28 个 Catch2 测试验证数学逻辑(GGX 值、Fresnel),但零个验证视觉输出。任何像素级的渲染回归在当前 CI 中完全无法检测。

目标

引入 Python 脚本(Pillow + NumPy),对 CPU 确定性渲染输出做 SSIM + MSE 比对,集成到 CI,作为所有后续渲染改动的安全网。

详细需求

  1. Python 测试脚本 scripts/test_golden.py

    • 固定种子运行 CPU 渲染器,输出当前帧
    • test/golden/ 下的参考图像做 SSIM + MSE 比对
    • SSIM > 0.999 通过,CI 直接失败则阻止合并
  2. 参考图像生成

    • test/golden/default_scene.png — 默认场景
    • test/golden/emissive_scene.png — 发光材质测试
  3. CI 集成

    • 在现有 build.yml 中新增独立 job
    • Debug + Release 均运行
    • pip install Pillow numpy scikit-image 作为前置步骤
  4. 确定性保证

    • 固定 PCG 随机种子
    • 必要时回退单线程以消除 std::execution::par 调度不确定性

验收标准

  • scripts/test_golden.py 在本地运行通过
  • CI 中 Python 测试 job 通过
  • SSIM > 0.999 判定标准生效
  • 参考图像已提交到 test/golden/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions