Add Krea2 next test plans
This commit is contained in:
@@ -50,6 +50,9 @@ testing, run:
|
||||
python tools/krea2_tuning_report.py
|
||||
```
|
||||
|
||||
The report includes atlas references plus prompt cues and avoid cues for the
|
||||
next fixed-seed test candidate.
|
||||
|
||||
## Optional Command Hook
|
||||
|
||||
If you have a one-shot Codex command you want to run automatically, set:
|
||||
|
||||
+45
-1
@@ -66,6 +66,34 @@ def coverage_summary() -> dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
def next_test_plans() -> list[dict[str, Any]]:
|
||||
rows_by_key = {str(row.get("key")): row for row in coverage_rows()}
|
||||
plans: list[dict[str, Any]] = []
|
||||
for key in coverage_summary()["next_test_candidates"]:
|
||||
variant = krea2_pose_variant_catalog.get_variant(key)
|
||||
if not variant:
|
||||
continue
|
||||
row = rows_by_key.get(key, {})
|
||||
evidence = variant.get("evidence") or {}
|
||||
plans.append(
|
||||
{
|
||||
"key": key,
|
||||
"family": variant.get("family") or "",
|
||||
"action_family": variant.get("action_family") or "",
|
||||
"status": variant.get("status") or "",
|
||||
"coverage_state": row.get("coverage_state") or "",
|
||||
"canonical_geometry": variant.get("canonical_geometry") or "",
|
||||
"prompt_cues": list(variant.get("prompt_cues") or []),
|
||||
"avoid_cues": list(variant.get("avoid_cues") or []),
|
||||
"reference_paths": [str(path) for path in krea2_pose_variant_catalog.reference_paths(key)],
|
||||
"generator_hook": variant.get("generator_hook") or {},
|
||||
"guide_section": evidence.get("guide_section") or "",
|
||||
"notes": evidence.get("notes") or "",
|
||||
}
|
||||
)
|
||||
return plans
|
||||
|
||||
|
||||
def markdown_report() -> str:
|
||||
lines = [
|
||||
"# Krea2 Pose Variant Coverage",
|
||||
@@ -87,5 +115,21 @@ def markdown_report() -> str:
|
||||
*[f"- {key}" for key in summary["next_test_candidates"]],
|
||||
]
|
||||
)
|
||||
plans = next_test_plans()
|
||||
if plans:
|
||||
lines.extend(["", "## Next Test Plans"])
|
||||
for plan in plans:
|
||||
lines.extend(
|
||||
[
|
||||
"",
|
||||
f"### {plan['key']}",
|
||||
"",
|
||||
f"- Geometry: {plan['canonical_geometry']}",
|
||||
f"- References: {', '.join(plan['reference_paths']) or 'none'}",
|
||||
"- Prompt cues:",
|
||||
*[f" - {cue}" for cue in plan["prompt_cues"]],
|
||||
"- Avoid cues:",
|
||||
*[f" - {cue}" for cue in plan["avoid_cues"]],
|
||||
]
|
||||
)
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
@@ -6863,9 +6863,26 @@ def smoke_krea2_tuning_report_policy() -> None:
|
||||
summary.get("variants_without_accepted_evidence") == ["pov_ballsucking_low_head"],
|
||||
f"Krea2 tuning report missing-evidence set changed: {summary.get('variants_without_accepted_evidence')}",
|
||||
)
|
||||
plans = krea2_tuning_report.next_test_plans()
|
||||
_expect([plan.get("key") for plan in plans] == ["pov_ballsucking_low_head"], "Krea2 tuning report next plans changed")
|
||||
ballsucking_plan = plans[0]
|
||||
_expect(
|
||||
"woman bends forward and kneels very low" in " ".join(ballsucking_plan.get("prompt_cues") or []),
|
||||
"Ballsucking test plan lost atlas-backed prompt cue",
|
||||
)
|
||||
_expect(
|
||||
"mid-height head placement" in " ".join(ballsucking_plan.get("avoid_cues") or []),
|
||||
"Ballsucking test plan lost avoid cue",
|
||||
)
|
||||
_expect(
|
||||
any(str(path).endswith("ballsucking/101_ballsucking.png") for path in ballsucking_plan.get("reference_paths") or []),
|
||||
"Ballsucking test plan lost atlas reference path",
|
||||
)
|
||||
markdown = krea2_tuning_report.markdown_report()
|
||||
_expect("pov_ballsucking_low_head" in markdown, "Krea2 tuning report markdown lost candidate variant")
|
||||
_expect("needs_fixed_seed_tests" in markdown, "Krea2 tuning report markdown lost coverage state")
|
||||
_expect("Prompt cues" in markdown, "Krea2 tuning report markdown lost next-test cue section")
|
||||
_expect("Avoid cues" in markdown, "Krea2 tuning report markdown lost next-test avoid section")
|
||||
|
||||
|
||||
def smoke_krea_pov_penetration_route() -> None:
|
||||
|
||||
Reference in New Issue
Block a user