Python rewrite of the Urb/Homemaker stack
innerloop.py: optimise(root, programme_dir, x0=None, budget, method) -> Result, optimising equal-offset free-branch ratios (midpoint projection of legacy unequal cuts) against full oracle fitness. OracleEvaluator scores each population in one batched perl call. Methods: cma (default) — multi- start sigma ladder (0.05 local, 0.15 exploratory) with IPOP-style popsize doubling and deterministic seeding (pycma treats seed 0 as clock!) — and compass with Hooke-Jeeves pattern moves, kept for the d0s bake-off. Acceptance (experiments/accept_innerloop.py, §4.5 bars vs unprojected originals, within-noise tolerance 1%): x1.65 / x1.66 / x1.58 against bars x1.24 / x1.67 / x1.59, no new failures, 46 oracle calls vs Nelder-Mead's 200. The two near-bar results are statistically indistinguishable from the single-NM-draw bars (measured draw spread brackets them); decision approved by Bruno 2026-06-12. Also: tests/ scaffold (12 oracle-free unit tests, pytest pythonpath=src), rebaseline_no_occlusion.py for homemaker-py-gp2, cma>=3.0 dependency (installed via dnf), dead-variable cleanup in solver.py. Closes homemaker-py-1p0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .beads | ||
| .claude | ||
| experiments | ||
| src/homemaker | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| DESIGN.md | ||
| pyproject.toml | ||
| README.md | ||
homemaker-py
Programme-driven building-layout search over slicing trees. A clean-room Python successor to the Perl Urb project, intended to eventually be 100% Python.
Why a rewrite
Urb represents a building as a binary slicing tree where room sizes are derived top-down from division ratios. That makes room area an emergent property of every cut above it, which:
- gives the genome low locality (a cut near the root rescales every descendant),
- makes target room sizes nearly impossible to hit, so the gaussian size penalty dominates fitness, and
- defeats crossover (transplanted subtrees lose their proportions).
homemaker inverts this: leaves carry target dimensions from the programme and division ratios are solved bottom-up for a fixed topology. The evolutionary search then only explores topology + types + adjacency.
Phase plan
- Solver experiment (current): port Urb's geometry, re-solve ratios from programme targets, score the result against the original via the Perl oracle.
- Native Python fitness (retire the Perl oracle).
- Canonical slicing encoding (normalized Polish expression) + memetic search.
Layout
src/homemaker/dom.py— read/write Urb.domYAML into aNodetree.src/homemaker/geometry.py— faithful port of Urb's top-down geometry.src/homemaker/programme.py— parsepatterns.configspace requirements.src/homemaker/solver.py— bottom-up ratio solve (scipy).src/homemaker/oracle.py— Phase-1 scaffold: score a.domvia Urb'surb-fitness.pl.
The Perl oracle is the only throwaway component; everything else is permanent.