Skip to content

refactor(examples): drop 139 try/except guards that could never fire - #428

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/dead-guards
Oct 5, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/dead-guards

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Closes #405.

Change

A scripted transform unwraps two shapes in 129 examples/ and showcase/ scripts:

  • try: <stmt> / except (AttributeError|KeyError|Exception): pass, single-line and multi-line forms;
  • only when <stmt> touches taa_render_samples or one of the input names Coat Weight, Specular IOR Level, Subsurface Weight or Detail Roughness.

That is 139 guards in total: 114 taa_render_samples plus 9 KeyError blocks, with the remainder in single-line forms. Every edited file ast.parses. No other try/except was touched.

Evidence

Probe, live (--factory-startup; binaries report 4.5.11 LTS, 5.1.2, 5.2.1 LTS):

  • scene.eevee.taa_render_samples = 64 succeeds under that version's EEVEE id and under Cycles.
  • Principled BSDF has Coat Weight, Specular IOR Level and Subsurface Weight on all three versions; Wave texture has Detail Roughness.

So none of the guards could ever fire on a supported version.

Scripts whose former KeyError guards were edited, check path on 5.2.1 and 4.5.11. All exit 0:

  • gn-sdf-remesh
  • grease-pencil-rosette
  • pond-edge
  • cactus-garden
  • palm-tree
  • sea-stack-arch
  • sawhorse-plank

The showcase material builders run on the check path, so these runs exercised the unguarded lines.

Render paths (--output --engine cycles, 5.2.1):

  • gn-sdf-remesh (former guard in render_still): exit 0, still written;
  • turntable (one-line taa guard): exit 0, still written.

Validators: check_helper_drift (--strict, variant counts unchanged), check_render_gates, check_engine_id, check_exit_code_readme, check_witnesses and check_falsifier_targets all pass. CI smoke runs every check path on 5.2 and 4.5.

Not run: the render paths of the other ~110 scripts. Their only change is an attribute assignment proven to exist on all three versions.

🤖 Generated with Claude Code

129 example and showcase scripts wrapped `scene.eevee.taa_render_samples`
and Principled v2 / Wave input names (Coat Weight, Specular IOR Level,
Subsurface Weight, Detail Roughness) in `except AttributeError/KeyError/
Exception: pass`. Probed on 4.5.11 LTS, 5.1.2 and 5.2.1 LTS: every one of
those attributes and sockets exists, so the guards were dead code that
would silently swallow a typo in exactly the kind of name this repo
exists to get right. The statements now run unguarded.

Closes #405

Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added examples Runnable smoke-gated examples under examples/ showcase Budget-conformance props under showcase/ labels Oct 5, 2026
@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 f30667e into main Oct 5, 2026
13 checks passed
@TMHSDigital
TMHSDigital deleted the fix/dead-guards branch October 5, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Runnable smoke-gated examples under examples/ showcase Budget-conformance props under showcase/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

examples/showcase: ~140 copies of dead try/except guards (taa_render_samples, Principled v2 sockets) can hide typos

1 participant