fix(packaging): 堵两处判定假绿 + 证据账读数可复跑(M249 r1 P2-1/2/3)
P2-1 判据 2:`Selected: AdapterInfo {` 与字段不在同一行时(pretty-print Debug 漂移)
`device_type` 取不到、旧写法默认 `"?"` 而 `"?" ∉ {Cpu,Other}` ⇒ 判绿。改成取不到即判红。
P2-2 判据 1:`"wgpu" in renderers` 是「曾经出现过」,把 CPU 那次的 stderr >> 追加进来
再配 CPU 那张图会判绿。改成 `set(renderers) == {"wgpu"}`(全部 [shot] 行都声称 wgpu)。
P2-3 doc §2:A6 `--expect-refuse` 那行的「3/3」需要传 PNG 路径才成立,按表复跑是 2/2;
命令列补上 PNG,并单列「不传 PNG = 2/2」一行。
行数:判据脚本 383 → 311(自测脚手架搬到 tests/gpu_shot_selftest.py,124 行;向量
16 → 19 条,红 16 / 绿 3,新增「多行 Debug」「空体」「混入异种 renderer」三条靶子)。
This commit is contained in:
1 parent
d7a9ae15a5
commit
9aefb6a5b0
5 files changed
+191
-114
No files matched your search
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"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 现造,不进仓库。",
|
||||
"note": "M249 check_gpu_shot.py --self-test 的向量。log = synth_log 的关键字覆盖(缺省键取函数默认值;null = 该行不出现;no_size_line = 只省掉 [shot] WxH 那一行;multiline_selected / empty_selected = `Selected: AdapterInfo {` 的字段换了形状;extra_shot_renderer = 再追加一行异种 renderer 的 [shot] 行);png = content/flat/truncated/null(null = 不写文件);mode = evidence/refuse;expect_fail = **期望的失败判据清单(逐条对,多一条少一条都算自测失败)**——判据被关掉或被别的东西掩盖,都在这里现形。PNG 由 check_screenshot.encode_png 现造,不进仓库。",
|
||||
"size": [200, 120],
|
||||
"cases": [
|
||||
{
|
||||
@@ -25,12 +25,30 @@
|
||||
"png": "content",
|
||||
"expect_fail": ["Selected: AdapterInfo 的 device_type 不是 Cpu/Other"]
|
||||
},
|
||||
{
|
||||
"label": "变异靶子:Selected 换成多行 Debug(字段不在 { 那一行)",
|
||||
"log": { "multiline_selected": true },
|
||||
"png": "content",
|
||||
"expect_fail": ["Selected: AdapterInfo 的 device_type 不是 Cpu/Other"]
|
||||
},
|
||||
{
|
||||
"label": "变异靶子:`Selected: AdapterInfo {` 空体(字段全丢)",
|
||||
"log": { "device_type": null, "empty_selected": true },
|
||||
"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": "变异靶子:日志里混入第二种 renderer(CPU 那次 >> 拼进来)",
|
||||
"log": { "extra_shot_renderer": "tiny-skia" },
|
||||
"png": "content",
|
||||
"expect_fail": ["截图行 renderer=wgpu"]
|
||||
},
|
||||
{
|
||||
"label": "回归:CPU 档出的图(renderer=tiny-skia)",
|
||||
"log": { "renderer": "tiny-skia", "device_type": null, "backend": "final=tiny-skia result=started" },
|
||||
@@ -72,14 +90,14 @@
|
||||
},
|
||||
{
|
||||
"label": "负例基线:via=refuse + 无出图行 + 无 PNG",
|
||||
"log": { "renderer": null, "device_type": null, "size": null, "backend": "final=none result=failed via=refuse" },
|
||||
"log": { "renderer": null, "device_type": null, "no_size_line": true, "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" },
|
||||
"log": { "renderer": null, "device_type": null, "no_size_line": true, "backend": "final=none result=failed via=refuse" },
|
||||
"png": "content",
|
||||
"mode": "refuse",
|
||||
"expect_fail": ["目标 PNG 不存在(拒绝出图就该一张都没有)"]
|
||||
|
||||
Reference in new issue
Block a user