Simplify
Some checks failed
Deploy to Pages / build (push) Failing after 10m45s

This commit is contained in:
Andras Schmelczer 2026-09-11 23:27:29 +01:00
commit 8bf3e3b705
40 changed files with 1443 additions and 1497 deletions

View file

@ -41,22 +41,22 @@ Totals across the same 84 cases, September 2026:
| Metric | Original | Minimise cuts | Maximise randomness |
| ------------------- | -------: | ------------: | ------------------: |
| Flooring saw passes | 2,177 | **1,741** | **2,113** |
| Flooring saw passes | 2,177 | **1,741** | **2,122** |
| Shaping passes | 192 | 184 | 188 |
| Rip passes | 414 | 402 | 409 |
| Legacy penalty | 265 | 2,207 | 346 |
| Flooring boards | 3,561 | 3,548 | 3,551 |
| Flooring waste | 8.20% | 7.85% | 7.94% |
| Rip passes | 414 | 402 | 411 |
| Legacy penalty | 265 | 2,279 | 350 |
| Flooring boards | 3,561 | 3,548 | 3,550 |
| Flooring waste | 8.20% | 7.85% | 7.91% |
| Invalid cases | 0 | 0 | 0 |
Minimise cuts saves **20.0%** of saw passes. Maximise randomness saves **2.9%** of saw
Minimise cuts saves **20.0%** of saw passes. Maximise randomness saves **2.5%** of saw
passes against the original planner. For random flooring in the default
4,800 × 3,600 mm room, 38 passes become **24** or **31**, respectively; both options use 76
boards and have approximately 1.2% waste.
Skirting drops from **1,447 to 1,436 passes**. It uses 521 boards instead of 513:
cutting effort now takes precedence over waste, which rises from 9.28% to 10.68%.
Eight cases improve and 76 tie.
Skirting drops from **1,447 to 1,437 passes**. It uses 522 boards instead of 513:
cutting effort now takes precedence over waste, which rises from 9.28% to 10.85%.
Seven cases improve and 77 tie.
For flooring, 78 cut-priority cases improve and six tie against the original planner.
The bounded search does not establish global optimality.
@ -70,14 +70,14 @@ numbers. A final bit-mixing step now spreads those candidates across the allowed
| Metric | Cuts before | Cuts now | Random before | Random now |
| ------------------------- | ----------: | -------: | ------------: | ---------: |
| Near-H row pairs | 515 | 247 | 557 | **6** |
| Saw passes | 1,741 | 1,741 | 1,994 | 2,113 |
| Boards | 3,537 | 3,548 | 3,579 | 3,551 |
| Waste | 7.57% | 7.85% | 8.66% | 7.94% |
| Near-H row pairs | 515 | 269 | 557 | **6** |
| Saw passes | 1,741 | 1,741 | 1,994 | 2,122 |
| Boards | 3,537 | 3,548 | 3,579 | 3,550 |
| Waste | 7.57% | 7.85% | 8.66% | 7.91% |
| Default-room near-H pairs | 17 | 17 | 11 | **0** |
| Default-room saw passes | 24 | 24 | 30 | 31 |
Appearance priority removes **98.9%** of near-H pairs for **6.0%** more cuts than the
Appearance priority removes **98.9%** of near-H pairs for **6.4%** more cuts than the
previous iteration. All six remaining pairs are in `forced-alternation`, whose
600 mm minimum pieces force alternating starts. It improves 79 cases and ties five
under the corrected objective. Ten additional room seeds also produce zero near-H pairs.
@ -96,19 +96,15 @@ this beside the laying-pattern choice. Both frozen baselines remain unchanged.
searching offcuts for pieces requiring both factory ends.
3. Repack completed boundary blanks, reserving exact complementary factory ends
first. Preserve the original placement and cutting order within each source board.
4. Try bounded swaps of interchangeable rectangular rows. Accept only a lower
pattern penalty with unchanged cuts, stock and geometry coverage.
5. Polish all surviving completed candidates, retaining the best result.
6. Preserve end remnants during search instead of trimming them immediately.
4. Polish all surviving completed candidates, retaining the best result.
5. Preserve end remnants during search instead of trimming them immediately.
This alone improves 56 cut-priority cases and saves another 99 passes after the
earlier improvements. Final packing can still combine non-exact blanks.
7. When repetition remains, compare an immediate-reuse search as well. This improves
6. When repetition remains, compare an immediate-reuse search as well. This improves
five appearance-priority cases. All searches share their clipping cache, and the
two UI choices select from the completed results. Selection itself does not rerun
the optimiser.
8. Compare exact three-piece skirting fills with the original packing. This improves
two cases for a small additional calculation cost.
9. Add the board-scale H penalty and mix the offset hash. Search size and geometry
7. Add the board-scale H penalty and mix the offset hash. Search size and geometry
constraints stay unchanged. Before/after drawings were checked for the default
rectangle, fireplace and large floor, alongside the numeric metrics.
@ -130,3 +126,22 @@ without an error; temporary stock is repacked before enforcing the board limit.
Tests enforce aggregate cutting budgets, broad H avoidance and physical invariants.
The original metrics and cases remain fixed; the new H metric has its own frozen
baseline so the correction does not rewrite the earlier results.
## Simplification tradeoffs
Removing row-swap polishing preserves all 1,741 cuts-first passes. Across the 84
cases, appearance-first passes change from 2,113 to 2,122 (+0.43%), boards from 3,551
to 3,550, and the legacy penalty from 346 to 350. Cuts-first near-H pairs change
from 247 to 269; appearance-first remains at six, all in the forced-alternation case.
Removing the exact three-piece skirting packing variant changes 1,436 passes to
1,437 and 521 boards to 522. Both frozen historical baselines remain unchanged.
The conditional immediate-reuse search stays: removing it introduced a near-H pair
outside the forced-alternation case. Distinct room-label and cut-preview placement
strategies also stay; their bounds and collision primitives are shared. There is
not enough evidence to replace these strategies without losing useful behavior.
Tests retain physical invariants, the two option priorities, near-H avoidance,
and aggregate budgets relative to the original baseline (at least 19% fewer
cuts-first passes; appearance-first and skirting use fewer passes than originally).
They no longer freeze the exact totals of a particular heuristic iteration.

View file

@ -58,7 +58,6 @@ export function plannerCases(): PlannerCase[] {
name: 'angled',
project: {
...angled.project,
version: defaultProject().version,
flooring: { ...defaultProject().flooring, ...angled.project.flooring },
} as Project,
},
@ -66,7 +65,6 @@ export function plannerCases(): PlannerCase[] {
name: 'angled-f8',
project: {
...angledF8.project,
version: defaultProject().version,
flooring: { ...defaultProject().flooring, ...angledF8.project.flooring },
} as Project,
},