test(render): pixel diff tests for wgpu compositor#211
Open
appergb wants to merge 1 commit into
Open
Conversation
…Foundation (#7) PoC 场景 + 像素 diff 框架,验证 wgpu 与上游对齐 - 已知点 affine 单测(对拍 CompositionBuilder.affineTransform L599-614) - 方向标记测试图(UV 翻转只一次) - 双轨混合顺序 + fade 包络 - PSNR/SSIM 工具
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
SPEC §6.2 要求 wgpu 合成器与上游 AVFoundation(
CompositionBuilder.swift)做像素 diff —— 这是"命门验证"。CI 无法跑 AVFoundation 生成黄金参考,故采用 SPEC §6.3 的 自洽 + 已知点验证 策略。新增
crates/opentake-render/tests/pixel_diff.rs(736 行,14 个测试)。自实现 PSNR/SSIM 工具,不加新依赖。纯函数测试(无 GPU,CI 必跑)
affine_centered_half_canvas_matches_hand_computed[0.5,0,0,0.5,25,25]affine_rotation_45_matches_compose_chainaffine_flip_horizontal_with_smaller_sourcecrop_to_uv_visible_insets_match_domain_fractionscompose_with_identity_is_noopfade_envelope_smoothstep_endpoints_and_midpointsmoothstep(0.2)=0.104vs linear0.2transform_keyframe_midframe_affine_equals_transform_atclip.transform_at(f)crop_keyframe_uv_varies_across_framesGPU 集成测试(headless 自动 skip,本地 Metal 真跑)
quadrant_markers_land_in_authored_cornersquadrant_round_trip_psnr_is_highhalf_opacity_two_track_blend_matches_hand_computed[~64,~128,0,255]fade_midframe_renders_half_brightnesstext_overlay_visible_above_videossim_identical_frames_score_near_one验收指标(SPEC §6.2 容差)
1e-9容差(亚像素级)本地验证
新增 14 + 既有 gpu_smoke(5)/gpu_text(1)/gpu_y_orientation/gpu_effects/gpu_downscaled_nat 全部通过。
工程纪律
tests/pixel_diff.rs,不改src/image已是 dev-dep)Part of #7(PoC 像素 diff 框架部分)