Files
Unlucky-Launcher/packaging/tests/gpu_shot_vectors.json
T
worker-gpushot 1f7dfd7bdd feat(packaging): GPU 截图证据判定 check_gpu_shot.py(M249 GPUSHOTGATE)
把 M246「这张图真是 GPU 档出来的」的人读判据固定成可复跑的门禁:
入参 = 一份 stderr 日志 + 一张 PNG(可选 --expect-refuse),逐条点名失败
的判据(不只印 FAILED),退出码 0/1/2。

判据:① `[shot] … renderer=wgpu`(不是 `[probe] renderer =`,那只是意图)
② `Selected: AdapterInfo` 的 device_type ∉ {Cpu, Other}(与 probe.rs:165-167
同口径)③ PNG 能解码且非空 ④ PNG 宽高 = 日志 [shot] 的宽高 ⑤ `[backend]
final=wgpu result=started` ⑥ 复用 check_screenshot.py 的非空白判据。
PNG 解码直接 import 同目录 check_screenshot,不复制第二份解码器。

--expect-refuse 是 A6 负例口径:via=refuse + 无出图行 + 目标 PNG 不存在。
--self-test 跑 tests/gpu_shot_vectors.json 的 16 条向量(红 13 / 绿 3),
每条给出期望的失败判据清单,变异(允许 Cpu / 删掉 renderer=wgpu 判据)
会让清单对不上而报红。

docs/gpu-evidence.md 记录能证什么(字形栅格与边缘 AA、面板 α 与玻璃、
两后端一致性)与不能证什么(首帧与帧率、整窗 α 与圆角观感 —— 走 DWM,
任何截图都拍不到),并写明历史 --diff 基线已永久不可复核。

本脚本尚未接进 CI(另一条 mission),本 mission 不改 Rust、不改 workflow。
2026-11-11 13:01:44 +08:00

103 lines
4.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"note": "M249 check_gpu_shot.py --self-test 的向量。log = synth_log 的关键字覆盖(缺省键取脚本默认值,null = 该行不出现);png = content/flat/truncated/null(null = 不写文件);mode = evidence/refuse;expect_fail = **期望的失败判据清单(逐条对,多一条少一条都算自测失败)**——判据被关掉或被别的东西掩盖,都在这里现形。PNG 由 check_screenshot.encode_png 现造,不进仓库。",
"size": [200, 120],
"cases": [
{
"label": "基线:wgpu + DiscreteGpu + 有内容 PNG",
"png": "content",
"expect_fail": []
},
{
"label": "基线:IntegratedGpu 也算硬件(与 probe.rs 同口径)",
"log": { "device_type": "IntegratedGpu" },
"png": "content",
"expect_fail": []
},
{
"label": "变异靶子:renderer=wgpu 但 Selected 是 Cpu(WARP)",
"log": { "device_type": "Cpu" },
"png": "content",
"expect_fail": ["Selected: AdapterInfo 的 device_type 不是 Cpu/Other"]
},
{
"label": "变异靶子:Selected 是 Other(Gl 兼容层)",
"log": { "device_type": "Other" },
"png": "content",
"expect_fail": ["Selected: AdapterInfo 的 device_type 不是 Cpu/Other"]
},
{
"label": "变异靶子:删掉 [shot] renderer 行(只剩 Selected + backend)",
"log": { "renderer": null },
"png": "content",
"expect_fail": ["截图行 renderer=wgpu"]
},
{
"label": "回归:CPU 档出的图(renderer=tiny-skia)",
"log": { "renderer": "tiny-skia", "device_type": null, "backend": "final=tiny-skia result=started" },
"png": "content",
"expect_fail": ["截图行 renderer=wgpu", "Selected: AdapterInfo 的 device_type 不是 Cpu/Other", "后端结论行 final=wgpu result=started"]
},
{
"label": "回归:没有 Selected 行(wgpu 没建成设备)",
"log": { "device_type": null },
"png": "content",
"expect_fail": ["Selected: AdapterInfo 的 device_type 不是 Cpu/Other"]
},
{
"label": "回归:后端结论行是失败",
"log": { "backend": "final=none result=failed via=refuse" },
"png": "content",
"expect_fail": ["后端结论行 final=wgpu result=started"]
},
{
"label": "回归:完全空白帧(全白 PNG)",
"png": "flat",
"expect_fail": ["PNG 不是空白帧"]
},
{
"label": "回归:PNG 尺寸与日志 [shot] 不符",
"png": "content",
"png_size": [640, 480],
"expect_fail": ["PNG 宽高 = 日志 [shot] 的宽高"]
},
{
"label": "回归:PNG 根本不存在",
"png": null,
"expect_fail": ["PNG 能解码且非空", "PNG 宽高 = 日志 [shot] 的宽高", "PNG 不是空白帧"]
},
{
"label": "回归:PNG 半截(签名对、字节不够)",
"png": "truncated",
"expect_fail": ["PNG 能解码且非空", "PNG 宽高 = 日志 [shot] 的宽高", "PNG 不是空白帧"]
},
{
"label": "负例基线:via=refuse + 无出图行 + 无 PNG",
"log": { "renderer": null, "device_type": null, "size": null, "backend": "final=none result=failed via=refuse" },
"png": null,
"mode": "refuse",
"expect_fail": []
},
{
"label": "负例回归:拒绝日志旁边却躺着一张 PNG",
"log": { "renderer": null, "device_type": null, "size": null, "backend": "final=none result=failed via=refuse" },
"png": "content",
"mode": "refuse",
"expect_fail": ["目标 PNG 不存在(拒绝出图就该一张都没有)"]
},
{
"label": "负例回归:CPU 档日志不是「拒绝」(via 缺)",
"log": { "renderer": "tiny-skia", "device_type": null, "backend": "final=tiny-skia result=started" },
"png": null,
"mode": "refuse",
"expect_fail": ["后端结论行 via=refuse", "没有出图行([shot] 尺寸 + renderer 都不该有)"]
},
{
"label": "负例回归:final=… via=refuse 却仍有出图行(自相矛盾)",
"log": { "backend": "final=none result=failed via=refuse" },
"png": "content",
"mode": "refuse",
"expect_fail": ["没有出图行([shot] 尺寸 + renderer 都不该有)", "目标 PNG 不存在(拒绝出图就该一张都没有)"]
}
]
}