Skip to content

[framework] bench2 preview emits preview_hard_zoom (three-view+iso) + CI gate (warns first) - #18

Merged
HaozheZhang6 merged 4 commits into
mainfrom
feat/preview-hard-zoom
Jul 28, 2026
Merged

[framework] bench2 preview emits preview_hard_zoom (three-view+iso) + CI gate (warns first)#18
HaozheZhang6 merged 4 commits into
mainfrom
feat/preview-hard-zoom

Conversation

@BenchCAD

@BenchCAD BenchCAD commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Makes the heldout three-view+iso a standard, reproducible output of bench2 preview, and starts gating on it.

Why

The four benchmark views (preview_views.png) are all diagonal isometric octants, so axis-aligned features (a hole pattern on a flat plate, a shaft crossing a duct) are hard to reconstruct. Heldout ships a preview_hard_zoom.png for exactly this — but it was generated by an ad-hoc script.

Changes

  • render.py: render_three_view() — front / side / top / iso. render_iso hard-codes up=(0,0,1), so a pure top front=(0,0,1) collapses the camera basis (blank panel); the top view uses a small forward tilt (near-plan) instead.
  • cli.py: bench2 preview also writes preview_hard_zoom.png for a deterministic hard example (hard, seed 0). Label column is 390 px (not the 300 px default) — a 2-params-per-line caption overran it and was clipped by the first panel.
  • family-pr-checks.yml: preview_hard_zoom.png is added to the package whitelist, and a new step 3b warns when it is missing.
  • DESIGN_SPEC / PR template / CONTRIBUTING: documented as the four-render set.

Warn, not require (changed from the first revision)

The first revision made the file a hard requirement. That is wrong to merge as-is:

So step 3b emits a ::warning:: with the exact command instead. Flipping it into the hard-required list (and backfilling main) is tracked in the follow-up issue.

Merge conflict resolved (this is why the PR was dirty)

main meanwhile rewrote family-pr-checks.yml, the PR template and CONTRIBUTING. Resolution keeps both sides, plus one real bug the auto-merge would have shipped:

main's new step 4 (package whitelist) did not list preview_hard_zoom.png. Combined with this branch's step 3, CI would have required the file and then rejected it as a stray file — every family PR that shipped it would fail. Whitelisted.

Verified

uv run bench2 preview re-run on both merged families on the merged tree: four panels, no blank/collapsed views, captions no longer clipped. speaker_pole_mount_socket is the case in point — the top plan shows the 4-hole pattern + bore that all four diagonal isos hide.

Pairs with adding family-pr-checks to the branch ruleset's required checks (separate, admin-side).

@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown

bench2 validate

slotted_din_rail

  ✓ family.json: keys + base_plane valid
  ✓ pieces: build(10 params) + PARAM_SPEC + check present
  ✓ PARAM_SPEC: 11 params, all entries complete
  ✓ easy: 4/4 seeds sample+check+build+execute clean
  ✓ medium: 4/4 seeds sample+check+build+execute clean
  ✓ hard: 4/4 seeds sample+check+build+execute clean
  ✓ difficulty separation: difficulties produce distinct programs
  ✓ geometry novelty: 6/12 unique shapes (50% duplicate)
  ✓ solids: every instance non-degenerate, 1 solid(s) each
PASS — designs/slotted_din_rail

speaker_pole_mount_socket

  ✓ family.json: keys + base_plane valid
  ✓ pieces: build(8 params) + PARAM_SPEC + check present
  ✓ PARAM_SPEC: 8 params, all entries complete
  ✓ easy: 4/4 seeds sample+check+build+execute clean
  ✓ medium: 4/4 seeds sample+check+build+execute clean
  ✓ hard: 4/4 seeds sample+check+build+execute clean
  ✓ coverage: bore_d reaches all 2 declared values (standard table fully covered)
  ✓ coverage: flange_od reaches all 2 declared values (standard table fully covered)
  ✓ coverage: flange_t reaches all 2 declared values (standard table fully covered)
  ✓ coverage: depth reaches all 6 declared values (standard table fully covered)
  ✓ difficulty separation: difficulties produce distinct programs
  ✓ geometry novelty: 9/12 unique shapes (25% duplicate)
  ✓ solids: every instance non-degenerate, 1 solid(s) each
PASS — designs/speaker_pole_mount_socket

Previews: the previews artifact on this run.

…require it

The four benchmark views are all diagonal isos, so axis-aligned features are hard
to read. Add render_three_view (front/side/top/iso, top uses a slight tilt to
avoid the up-vector collapse of a pure (0,0,1) view) and have 'bench2 preview'
emit preview_hard_zoom.png for a hard example — a real three-view a reviewer can
reconstruct the part from. family-pr-checks now requires it (7 files); DESIGN_SPEC
/ PR template / CONTRIBUTING updated to the four-render set.

Signed-off-by: BenchCAD <benchcad@users.noreply.github.com>
@BenchCAD
BenchCAD force-pushed the feat/preview-hard-zoom branch from 45c4202 to 54b1aa6 Compare July 19, 2026 17:13
HaozheZhang6 and others added 2 commits July 21, 2026 22:24
Resolve against main's newer family-pr-checks/template/CONTRIBUTING:

- family-pr-checks: main added a package whitelist (step 4) that did NOT list
  preview_hard_zoom.png, so requiring the file (step 3) and rejecting it as a
  stray file would have contradicted each other — whitelist it.
- preview_hard_zoom.png is WARNED about, not required: every family PR opened
  before this branch is based on pre-#18 main and literally cannot generate the
  file, and the two families already merged to main lack it too. Hard-failing on
  merge would turn 11 open community PRs red at once. Step 3b warns with the
  exact command; flip it into step 3 once the backlog and main are backfilled.
- PR template / CONTRIBUTING: keep main's added links and rules, state the
  four-render set with the fourth marked as warn-now/required-soon.
- cli.py: widen the hard-zoom label column 300 -> 390 px; a 2-params-per-line
  caption overran 300 px and was clipped by the first panel (verified by
  re-rendering slotted_din_rail + speaker_pole_mount_socket).

Signed-off-by: BenchCAD <benchcad@users.noreply.github.com>
@BenchCAD BenchCAD changed the title [framework] bench2 preview emits preview_hard_zoom (three-view+iso) + require it [framework] bench2 preview emits preview_hard_zoom (three-view+iso) + CI gate (warns first) Jul 27, 2026
@HaozheZhang6
HaozheZhang6 merged commit 2d29dd1 into main Jul 28, 2026
4 checks passed
@HaozheZhang6
HaozheZhang6 deleted the feat/preview-hard-zoom branch July 28, 2026 09:30
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.

2 participants