Skip to content

release: v0.6.2 — Max densify performance for production nfp path - #5

Merged
TexasCoding merged 6 commits into
mainfrom
perf/max-densify-once-multistart
Jul 11, 2026
Merged

TexasCoding merged 6 commits into
mainfrom
perf/max-densify-once-multistart

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Summary

Speeds up the production nesting path (strategy=nfp, restarts=8, separation_effort=max, column_weight=3) while keeping Full/Fast defaults and goldens byte-identical.

  • Densify-once multi-start: Max with restarts>1 explores at Fast leftover cost, NestScore keep-best, densifies only the winner
  • Max leftover = Fast: pre-densify leftover insertion uses Fast budgets + area-skip (no more Full over-sub thrash under Max)
  • Fast densify sep budget: separate_layout uses SEP_CONFIG_FAST (was much heavier)
  • Pose-only snapshots: skip cloning container on sep/densify restore path
  • NFP difference_query: zero-area drop only on feasible-region queries (candidates re-sort)

Measured (cone+square all-fit remnant corpus): Max w3 K=8 ~20 s → ~190 ms, remnant held (56.8%, max_x 103.6). See docs/04 §4e.

Test plan

  • cargo fmt --all --check
  • cargo clippy --workspace --exclude ironnest-py --all-targets --locked -- -D warnings
  • cargo test --workspace --exclude ironnest-py --locked
  • cargo test --workspace --exclude ironnest-py --release --locked
  • cargo test -p ironnest-optimizer --features parallel --release --locked
  • CI green on macOS-arm64 / Windows-x64 / linux-x64

Release

Workspace version 0.6.2. After merge: tag v0.6.2 to publish wheels via wheels.yml.

Max multi-start previously densified every start then discarded losers,
multiplying the dominant densify cost by K. Explore at Full, NestScore
keep-best, densify only the winner. Also skip empty densify refills and
return the prior container from swap_container to avoid per-step clones.
K=1 Max / Full / Fast goldens unchanged.
Align densify separate_layout with SEP_CONFIG (was 200×6 strikes,
now the same 150×4 as Full leftover sep). Remnant held on the cone+square
corpus (56.8%, max_x 103.6); Max K=1 wall 2570→1306 ms. Add NestScore
plateau early-stop (no win when score improves until the end; cheap
safety net). Goldens unchanged.
Layout::restore never reloads the container, but save() cloned it on every
separator improvement, try_insert, and densify keep-best. Add save_poses/
restore_poses (items + CDE only) and use them on the fixed-container path.
Byte-identical (goldens hold); densify wall is sample-bound so the win is
mostly avoided waste / allocation pressure.
Densify multiplies its sep budget × shrink steps; Full was overkill once
NestScore keep-best + 1% shrinks were in place. Use SEP_CONFIG_FAST for
separate_layout — Max w3 K=1 densify ~2570→150 ms with remnant held
(56.8%, max_x 103.6); goldens unchanged.

Also use difference_query on feasible_region (zero-area drop only, no
Booth canonicalize): candidates re-sort by cost so the multiset is
byte-identical while skipping per-placement full canonicalization.
Max previously ran Full leftover insertion then densify — on over-sub
packs that is the ~97 s hopeless-insert tax. Use Fast leftover (area-skip
+ reduced budget) under Max, then densify as before. Densify-once multi-
start explores at Fast too. All-fit remnant held; goldens unchanged.
Speed up separation_effort=max under the station defaults
(strategy=nfp, restarts=8, column_weight=3) without changing Full/Fast
defaults or goldens:

- Densify-once multi-start: explore at Fast leftover, densify NestScore
  winner only (cuts densify from K× to 1×)
- Max leftover insertion uses Fast budgets + area-skip (avoids Full's
  over-sub tax); densify sep budget aligns with SEP_CONFIG_FAST
- Pose-only layout snapshots on sep/densify (skip unused container clone)
- Query-path NFP difference_query (no per-placement Booth canonicalize)

Measured on cone+square remnant corpus: Max w3 K=8 ~20 s → ~190 ms with
remnant held (56.8%, max_x 103.6). docs/04 §4e.
@TexasCoding
TexasCoding merged commit cbc641f into main Jul 11, 2026
5 checks passed
@TexasCoding
TexasCoding deleted the perf/max-densify-once-multistart branch July 11, 2026 12:24
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