Skip to content

fix(tests): cover the helpers the drift check never saw - #440

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/helper-drift-coverage
Oct 5, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/helper-drift-coverage

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #361.

What changed

In tests/check_helper_drift.py:

  • Seven helpers added to CANONICAL: hull_collider, setup_bake_image, bake_normal, face_area, uv_stats, zfight_pairs and wire_normal. Each has its measured variant count and the reason each extra variant exists, written from reading the variant diffs.
  • A literals flag. Flagged helpers are hashed with string constants and ALL_CAPS names blanked, so a per-piece image name ('AnvilNrm' vs 'HoopNrm') or material index (WOOD_IDX vs STEEL_IDX) does not count as a new body. This replaces the issue's "parameterise the image name" without editing 76 scripts.
  • Hull callers must be listed. Any top-level function that calls bmesh.ops.convex_hull must be in CANONICAL, so a hull copied under a new name is reported as drift.

Not changed

  • is_valid guard in hull_collider: not ported. All 15 copies call bmesh.ops.delete once, over a deduplicated list of verts that all still exist, so no vert can be invalid when the guard would run.
  • snippets: convex_hull_collider keeps the source faces, producing non-manifold colliders with duplicate faces #386 edge fix: does not apply here, because these copies hull bare points rather than a copy of the source mesh.
  • Converging the variants: this PR records them; it does not merge them. One semantic difference is noted in the reason: uv_stats' bucketed-grid variant returns (..., 0.0, 0) on a mesh with no UVs.

Evidence (local runs)

  • check_helper_drift.py --strict exits 0 with all 12 helpers ok.
  • Falsifier: with hull_collider removed from CANONICAL, unlisted_hull_callers() reports the 15 copies and --strict exits 1.
  • Literal blanking does the collapsing: without the literals flag, setup_bake_image has 75 variants and wire_normal 11; with it, 3 and 10.
  • Only convex_hull_collider (60 pieces) and hull_collider (15) call bmesh.ops.convex_hull today.

Inspection only: the variant rationales come from reading the AST diffs, not from runs.

🤖 Generated with Claude Code

check_helper_drift.py only knew five helper names, so copies kept under
other names drifted unseen: 15 hull_collider bodies, 75 setup_bake_image
bodies, and the uv_stats, face_area, bake_normal, zfight_pairs and
wire_normal families.

- List those seven helpers in CANONICAL with measured variant counts and
  the reason each extra variant exists.
- A helper marked "literals" is hashed with string constants and ALL_CAPS
  names blanked, so a per-piece image name or material index is not a new
  body. setup_bake_image goes from 75 variants to 3 and wire_normal from
  11 to 10, without editing 76 scripts.
- Any function calling bmesh.ops.convex_hull must be listed, so a hull
  copied under a new name is reported.

The hull_collider copies hull bare points, so the source-edge bug fixed in
#386 does not apply to them, and their single delete call over a
deduplicated vertex list needs no is_valid guard.

Closes #361

Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TMHSDigital

Copy link
Copy Markdown
Owner Author

CI evidence before merge: all checks pass ( 13 pass ). Blender Smoke on PR head: Blender 5.2.2 LTS / Blender 4.5.14 LTS. Summaries (happy path; falsifiers) per leg: 141 passed, 3 skipped, 0 failed;136 passed, 7 skipped, 0 failed;143 passed, 1 skipped, 0 failed;143 passed, 0 skipped, 0 failed;

@TMHSDigital
TMHSDigital merged commit a31d5eb into main Oct 5, 2026
13 checks passed
@TMHSDigital
TMHSDigital deleted the fix/helper-drift-coverage branch October 5, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

showcase: helper-drift check is bypassed by renamed copies (hull_collider x15, setup_bake_image x75 variants) (#344 incomplete)

1 participant