Skip to content

release: v0.6.0 — separation-effort tiers + PreparedParts + remnant densification - #4

Merged
TexasCoding merged 4 commits into
mainfrom
feat/perf-tiers-and-densification
Jul 11, 2026
Merged

TexasCoding merged 4 commits into
mainfrom
feat/perf-tiers-and-densification

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

v0.6.0 — density & speed knobs (opt-in, byte-identical defaults)

Builds on v0.5.0's exact-NFP mode. All new behaviour is opt-in; default arguments stay
byte-identical, so the cross-platform determinism contract holds (goldens re-blessed only where a
placement deliberately changed).

Features

  • separation_effort (NestConfig field + Python kwarg):
    • "fast" — area-conservation hopeless-skip + reduced separator budget: ~15× (NFP) / 18×
      (sampling)
      on over-subscribed packs, ≤1 part cost.
    • "max" — a densification/compaction pass (shrink toward a corner + full-layout GLS
      re-separate + NFP refill) that maximizes the usable end remnant (measured 53% → 57% on a
      cone+square probe).
  • PreparedParts (prepare() / nest_with_prepared() + ironnest.prepare()): reuse the
    container-independent item import + O(P²) pairwise NFP table across calls — 11.8× on a 15-container
    part-in-part run, byte-identical.
  • column_weight (NestConfig field + kwarg, default 10): the LBF horizontal weight for NFP
    candidate ranking; 3 closes vertical gaps between irregular parts.
  • Remnant-first best-of-K multi-start keep-best (NestScore: max placed area, then min
    used_x_max/used_y_max, earliest-k on tie) across all entry points.

Perf / dev

  • [profile.dev] opt-level = 2 — the engine is compute-bound, so cargo test ran ~12× slow at
    opt-level 0 (golden test 633 s → 51 s). Byte-identical (codegen-only).
  • NFP micro-opts (per-type buffer hoist, capacity hints).

Determinism

  • Determinism-auditor swept the diff CLEAN (no f32 / HashMap / std-trig / threads / env on the
    placement path; all keep-best via total_cmp; restarts=1 byte-identical).
  • New golden cases pin the Fast and Max tiers cross-platform; only the multistart-mixed case was
    re-blessed (area-tie → remnant-first tie-break).
  • 77 optimizer tests pass; workspace clippy -D warnings clean (incl. --features parallel).

Recommended for remnant jobs

strategy="nfp", column_weight=3, restarts>=8, separation_effort="max".
Byte-stable default: column_weight=10, restarts=1, separation_effort="full".

See docs/04-performance-remediation-plan.md.

🤖 Generated with Claude Code

TexasCoding and others added 4 commits July 10, 2026 20:27
… tests

Performance + density work (docs/04-performance-remediation-plan.md):

- perf(build): [profile.dev] opt-level=2 — the engine is compute-bound, so
  `cargo test` ran ~12x slow at opt-level 0 (golden test 633s -> 51s).
  Byte-identical (opt-level is codegen-only, no IEEE change); goldens unchanged.

- feat(sep): SeparationEffort knob (NestConfig field + Python separation_effort=).
  * Fast: area-conservation hopeless-skip + reduced separator budget for
    over-subscribed packs — 15x (NFP) / 18x (sampling) on the mixed-13 pack at
    <=1 part cost. Opt-in; Full default byte-identical; two new golden cases.
  * Max: densification/compaction — shrink the sheet along the slack axis and
    re-separate the whole layout to close inter-part gaps, maximizing the usable
    remnant (v1: +2.8pp remnant on a cone case; the local search plateaus, and a
    stronger global search is the documented next step).

- feat(api): PreparedParts (prepare()/nest_with_prepared() + Python
  ironnest.prepare()) — reuse the container-independent item import + O(P^2) NFP
  table across calls (part-in-part): 11.8x on 15 containers, byte-identical
  (test prepared_equals_nest_with_config_byte_for_byte).

- perf(nfp): buffer hoisted to one clone per type in place_pass; candidates()
  capacity hints. Byte-identical.

- diagnostic examples: perf_diag, prepared_bench, density_probe, density_remnant.

All 77 optimizer tests pass; workspace clippy -D warnings clean (incl.
--features parallel); cross-platform golden re-blessed for the new Fast cases
(existing cases byte-identical, verified by direct snapshot diff).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sify refill

Builds on the separation-effort tiers (dcfafc7). Goal: maximize the usable
remnant (a clean free strip at the sheet end), not raw utilization. Reviewed +
verified (determinism-auditor CLEAN; 77 tests pass; clippy -D warnings clean).

- feat(api): NestConfig.column_weight (Python `column_weight=`, default 10) — the
  LBF horizontal weight for NFP candidate ranking (cost = w*x_max + y_max). The
  historical 10 over-forces strict left-columns; w=3 closes vertical gaps between
  irregular parts. Default 10 is bit-identical, and this REMOVES the temporary
  IRONNEST_XW env hook that dcfafc7 accidentally shipped (a latent placement-path
  env read). Exposes DENSITY_COLUMN_WEIGHT=3 + nest_with_prepared_weighted.

- feat(multistart): remnant-first keep-best (NestScore: max placed area, then min
  used_x_max, then min used_y_max, earliest k on tie) across ALL multi-start entry
  points + the densify keep-best. Deterministic: all total_cmp over slotmap-order
  sums + libm-deterministic bboxes; restarts=1 stays byte-identical. Re-blessed the
  multistart-mixed golden (the only case with area-ties).

- feat(sep): Max densify now uses the remnant-first score + a post-densify NFP
  contact refill (obstacles_from_layout + budget=0 place_pass). Measured on the
  cone+square remnant probe: remnant 53.0% -> 57.0% (max_x 112.8 -> 103.4).

- test: nfp-max-densify golden case pins the Max tier's cross-platform
  determinism; fixed a stale multistart-overflow comment.

Recommended for remnant jobs: strategy="nfp", column_weight=3, restarts>=8,
separation_effort="max". Byte-stable default: 10 / 1 / "full".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… prepare)

Version 0.5.0 -> 0.6.0. README documents the new density/speed knobs
(strategy="nfp", restarts, separation_effort full/fast/max, column_weight) and
the prepare()/PreparedParts part-in-part reuse.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parallel_multistart_equals_independent_sequential_best (--features parallel only,
so it slipped past local `cargo test`) reconstructed the sequential best-of-K
with an OLD area-only argmax, which no longer matches the engine's remnant-first
NestScore keep-best (equal-area starts now break the tie on used_x_max). The
engine is consistent (parallel and sequential both use keep_best_start); only the
test's mirror was stale.

Add a doc(hidden) multistart_start_scored hook returning each start's exact
NestScore tuple (placed_area, used_x_max, used_y_max) so the test mirrors the
engine's reduction exactly. Passes under --features parallel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TexasCoding
TexasCoding merged commit dffed5b into main Jul 11, 2026
5 checks passed
@TexasCoding
TexasCoding deleted the feat/perf-tiers-and-densification branch July 11, 2026 03:11
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.

1 participant