Prepare lean solver for hosted shipping
This commit is contained in:
parent
2c656908e9
commit
5f2a644906
35 changed files with 1839 additions and 1948 deletions
|
|
@ -2,16 +2,17 @@
|
|||
"branches": [
|
||||
{
|
||||
"id": "main",
|
||||
"hypothesis": "A lean phase-field solver plus structure-aware evaluation can repixelize fake pixel art better than resize baselines without reviving optimizer sprawl.",
|
||||
"hypothesis": "A lean explicit phase-field solver plus structure-aware evaluation can repixelize fake pixel art better than resize baselines without reviving optimizer sprawl.",
|
||||
"status": "active",
|
||||
"artifacts": [
|
||||
"state/map.yaml",
|
||||
"state/scratch.md",
|
||||
"state/evidence.jsonl",
|
||||
"docs/implementation-plan.md",
|
||||
"docs/lean-optimizer-algorithm-map.md"
|
||||
"docs/lean-optimizer-algorithm-map.md",
|
||||
"docs/solver-tuning-lessons-2026-04-29.md"
|
||||
],
|
||||
"notes": "Active mainline. Current solver work should stay anchored to the pinned badge case and the sword-tip focus fixture."
|
||||
"notes": "Active mainline. Current priority is shipping the hosted experiment with the usable radius=0.215/blend=0.24 solver config; later solver tuning should start from that basin and sweep signal knobs first."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,22 @@
|
|||
{"ts":"2026-04-26T00:00:00Z","type":"design","status":"accepted","note":"Repixelizer now has one live reconstruction engine: phase-field in src/repixelizer/phase_field.py. The old tray-based optimizer is gone."}
|
||||
{"ts":"2026-04-26T00:00:00Z","type":"metric","status":"accepted","note":"source_structure is tracked alongside source_fidelity because lattice-only scoring could rank visibly better outputs as worse."}
|
||||
{"ts":"2026-04-26T00:00:00Z","type":"regression","status":"rejected","note":"The d9fa411 phase-field tuning pass was a real regression on the pinned badge case; reverting it restores the known-good badge result exactly."}
|
||||
{"ts": "2026-04-26T03:57:11+00:00", "type": "docs", "status": "ok", "note": "Audit pass clarified note boundaries: the algorithm map remains the live control-flow truth, the implementation plan remains the forward hypothesis ledger, and hosted-auth-architecture is explicitly future design rather than landed auth machinery."}
|
||||
{"ts": "2026-04-26T04:05:06+00:00", "type": "design", "status": "accepted", "note": "Hosted auth was split into a reusable GameCult hosted-access architecture plus a thin Repixelizer-specific access profile. Recommended extraction path is an embedded shared gamecult_access layer first, with dedicated service only after a second app proves the need."}
|
||||
{"ts": "2026-04-26T04:52:53+00:00", "type": "design", "status": "accepted", "note": "Hosted convenience is the monetization path for Repixelizer; keep the code open, let self-hosting remain the escape hatch, and do not prioritize native desktop packaging unless it clearly beats hosted access on revenue, support burden, or strategy."}
|
||||
{"ts": "2026-04-26T12:56:28+00:00", "type": "research", "status": "ok", "note": "Added dense landscape fixture tests/fixtures/real/dense-landscape.png plus tracked fixed-512 output. Current automatic lattice inference on the 1254px source undershoots to 251x251, so README previews now include that case with the fixed 512x512 result beside Lanczos."}
|
||||
{"ts": "2026-04-26T13:14:17+00:00", "type": "research", "status": "ok", "note": "Dense landscape auto inference misses high because spacing stats split between false small-cell harmonics and mushier real-cell intervals. The spacing spectrum actually guides toward 415/418 and 251, but src/repixelizer/inference.py caps automatic major-axis candidates at 256, silently discarding the denser 415/418 branch; among the surviving sizes, reranking picks 251. Current coherence scoring on the fixture is much stronger around 415-418 than at 251."}
|
||||
{"ts": "2026-04-26T13:53:17+00:00", "type": "research", "status": "ok", "note": "Relaxed automatic candidate search so high guided sizes from the spacing spectrum can survive above the old 256 cap. On tests/fixtures/real/dense-landscape.png, auto inference now lands at 418x418 instead of 251x251; still short of the fixed 512x512 target, but no longer throwing away most of the detail before scoring starts."}
|
||||
{"ts": "2026-04-26T15:46:23+00:00", "type": "research", "status": "rejected", "note": "Tried a projected edge-energy spectral lattice prior and removed it before ship. On tests/fixtures/real/dense-landscape.png it floor-hugged to a 2px rhythm and widened the candidate family toward bogus 626-size aliases, so the searched path is back to change-interval evidence plus autocorrelation."}
|
||||
{"ts": "2026-04-26T17:46:30+00:00", "type": "research", "status": "ok", "note": "Removed pixel-walk / change-interval sizing from src/repixelizer/inference.py and switched searched lattice inference to autocorrelation-only priors and candidate hints. Badge auto inference no longer gets pruned into the old 115-family by spacing-spectrum guidance; it now searches inside the 120-126 neighborhood while dense landscape still lands at 418x418."}
|
||||
{"ts": "2026-04-26T17:58:43+00:00", "type": "research", "status": "ok", "note": "Autocorr inference now keeps a tiny near-best lag plateau and searches for cross-axis consensus before collapsing to one lattice size. On the real badge fixture this preserves x-axis support for 10px alongside 11px, raises the shared prior to the 125-family, and restores auto inference to 125 with top candidates 125/126/124/127/123 while dense landscape remains 418x418."}
|
||||
{"ts": "2026-04-26T18:19:52+00:00", "type": "design", "status": "accepted", "note": "Hosted demo jobs now use direct autocorr lattice inference with capped by the hosted output limit. The hosted path no longer silently pins unspecified jobs to max_output_dimension, and candidate rerank is forced off there while the full local workflow keeps searched autocorr inference available."}
|
||||
{"ts": "2026-04-26T22:40:02+00:00", "type": "design", "status": "accepted", "note": "Hosted mode now owns a distinct public front door in src/repixelizer/gui.py: / serves a landing page there, while local and self-host runs still redirect root straight to /app/. This keeps future auth and member-gating surgery in the hosted web layer instead of smearing it into the self-deploy path or the solver stack."}
|
||||
{"ts": "2026-04-26T22:57:43+00:00", "type": "design", "status": "accepted", "note": "Repixelizer is now auth-ready at the hosted web boundary without landing real Heimdall auth. src/repixelizer/access.py owns the local access seam, src/repixelizer/gui.py binds request subjects and guards hosted routes, queued jobs now carry local owner metadata, and self-host remains permissive by default unless GC_ACCESS_* turns the seam on."}
|
||||
{"ts": "2026-04-26T23:34:24+00:00", "type": "design", "status": "accepted", "note": "Repixelizer now consumes Heimdall entirely inside the hosted web layer. GC_ACCESS_MODE=heimdall creates local auth attempts, asks Heimdall to start provider OAuth, accepts the direct backend callback, verifies Heimdall Ed25519 access tokens locally, and adopts httpOnly cookie sessions without dragging provider tokens through browser URLs or solver code."}
|
||||
{"ts": "2026-04-28T16:23:58+00:00", "type": "benchmark", "status": "ok", "note": "Manual tuning found the first robust improvement is reducing explicit solver local search movement, not increasing signal. On the 8-case soft+ai slice, baseline scored 0.6014; radius=0.60/blend=0.10 scored 0.2804; radius=0.60/blend=0.07 scored 0.2687. Stronger signal worsened the slice, and higher spring weight above 4.0 had no effect because the spring step is already clamped."}
|
||||
{"ts": "2026-04-28T16:23:58+00:00", "type": "benchmark", "status": "ok", "note": "Full validation across 38 cases x soft/crisp/ai at seed 23 favored radius=0.60/blend=0.07 over baseline: score 0.5790 vs 0.7702, mean row score 0.2814 vs 0.4552, worst row 1.2734 vs 1.5050; 97/114 rows improved, 14 regressed."}
|
||||
{"ts": "2026-04-28T16:23:59+00:00", "type": "benchmark", "status": "pending", "note": "Regression-guard validation on known bad rows found tighter radius may be better before shipping: r050-b007 scored 0.4075 with worst 0.6949 on the guard set, beating r060-b007 at 0.6278/worst 1.3589. Full-corpus validation is still required before updating config/solver_params.json."}
|
||||
{"ts": "2026-04-26T00:00:00Z", "type": "design", "status": "accepted", "note": "Repixelizer has one live reconstruction engine: phase-field in src/repixelizer/phase_field.py. The old tray-based optimizer is gone and should not be revived without a new design map."}
|
||||
{"ts": "2026-04-26T00:00:00Z", "type": "metric", "status": "accepted", "note": "source_structure is tracked alongside source_fidelity because lattice-only scoring can rank visibly better outputs as worse."}
|
||||
{"ts": "2026-04-26T03:57:11+00:00", "type": "docs", "status": "accepted", "note": "State surface boundaries: docs/lean-optimizer-algorithm-map.md is live control-flow truth, docs/implementation-plan.md is the forward plan, state/map.yaml is durable current truth, scratch is disposable, and evidence is distilled belief only."}
|
||||
{"ts": "2026-04-26T04:52:53+00:00", "type": "design", "status": "accepted", "note": "Hosted convenience is the monetization path; keep the code open, let self-hosting remain the escape hatch, and do not prioritize native desktop packaging unless it clearly beats hosted access on revenue, support burden, or strategy."}
|
||||
{"ts": "2026-04-26T13:53:17+00:00", "type": "inference", "status": "accepted", "note": "Dense landscape exposed that hard automatic caps can silently discard the useful high-detail branch. Autocorr candidate inference must preserve plausible high-size candidates before reranking rather than pruning detail early."}
|
||||
{"ts": "2026-04-26T15:46:23+00:00", "type": "research", "status": "rejected", "note": "Projected edge-energy spectral lattice prior was removed before ship: on dense landscape it floor-hugged to a 2px rhythm and widened toward bogus 626-family aliases. Do not revive it casually."}
|
||||
{"ts": "2026-04-26T17:58:43+00:00", "type": "inference", "status": "accepted", "note": "Autocorr inference keeps near-best lag plateaus and searches for cross-axis consensus before collapsing to one lattice size. This restored badge inference to the 125-family while dense landscape stayed around 418."}
|
||||
{"ts": "2026-04-26T22:40:02+00:00", "type": "hosted", "status": "accepted", "note": "Hosted mode owns the public front door in src/repixelizer/gui.py: / serves a landing page there, while local/self-host runs redirect root to /app/. Keep hosted auth/member-gating in the web layer, not the solver."}
|
||||
{"ts": "2026-04-26T23:34:24+00:00", "type": "hosted", "status": "accepted", "note": "Repixelizer consumes Heimdall only inside the hosted web layer. GC_ACCESS_MODE=heimdall verifies Heimdall Ed25519 access tokens locally and adopts httpOnly local sessions without dragging provider tokens through browser URLs or solver code."}
|
||||
{"ts": "2026-04-28T16:23:58+00:00", "type": "tuning", "status": "accepted", "note": "Manual tuning proved the first robust improvement came from reducing explicit solver local search movement, not from increasing signal. Stronger signal worsened early slices; higher spring weight above the cap did nothing."}
|
||||
{"ts": "2026-04-28T16:23:59+00:00", "type": "tuning", "status": "accepted", "note": "Full-corpus manual tuning initially selected radius=0.60/blend=0.05: score 0.5483, mean 0.2732, worst 1.1902 across 38 cases x soft/crisp/ai, improving 100/114 rows over baseline. Superseded later as current config, but useful as movement-geometry history."}
|
||||
{"ts": "2026-04-29T00:00:00+00:00", "type": "signal", "status": "accepted", "note": "The old quiet-near-boundary / context-energy signal and the wall-distance detour were both wrong shapes. The live signal is direct hierarchical flatness: multiscale luminance gradient/Laplacian energy, one normalization, inverted to flatness, then peak-shaped."}
|
||||
{"ts": "2026-04-29T00:30:00+00:00", "type": "benchmark", "status": "accepted", "note": "Benchmark/tune paths gained CPU worker parallelism for row-level roundtrip evaluation. Use workers for future tuning instead of dragging the harness through serial mud."}
|
||||
{"ts": "2026-04-29T08:36:03+00:00", "type": "tuning", "status": "accepted", "note": "Focused supervised tuning around the corrected signal found the current live motion geometry: radius=0.215, blend=0.24, move=0.09, grid=4.75, energy=1.4, peak=3.25. It is shippable but not fully signal-retuned."}
|
||||
{"ts": "2026-04-29T08:54:03+00:00", "type": "tuning", "status": "accepted", "note": "docs/solver-tuning-lessons-2026-04-29.md is the detailed tuning ledger. Future tuning should sweep signal knobs around radius=0.215/blend=0.24 first, then movement/coherence, then combinations, with full-corpus validation only at the end."}
|
||||
{"ts": "2026-04-29T09:23:44+00:00", "type": "asset", "status": "accepted", "note": "Landing character asset must be regenerated through hosted GUI/autocorr defaults, not obsolete searched inference. The wrong path produced 106x106; hosted autocorr defaults produce the expected 139x139."}
|
||||
{"ts": "2026-04-29T09:34:39+00:00", "type": "implementation", "status": "accepted", "note": "Searched inference was removed as a vestigial organ. Automatic inference is autocorr-only; autocorr candidates remain rerankable; hosted mode no longer forces rerank off."}
|
||||
{"ts": "2026-04-29T09:48:26+00:00", "type": "implementation", "status": "accepted", "note": "Lattice phase controls/search were removed. The solver initializes from fixed lattice centers and moves the explicit source-position field directly; users should not be exposed to lattice phase knobs."}
|
||||
{"ts": "2026-04-29T10:09:47+00:00", "type": "implementation", "status": "accepted", "note": "Source hygiene pass removed dead SolverHyperParams, stale tuning-campaign knobs, fake iterative cleanup, old guidance observer names, and solver-analysis call sites. Analysis remains only as a diagnostic edge preview; it does not steer the solver."}
|
||||
{"ts": "2026-04-29T10:09:47+00:00", "type": "verification", "status": "ok", "note": "Post-cleanup verification passed: AST parse succeeded across source/script/tool/test Python files and targeted stale-string scans found no removed solver params, fake cleanup hooks, old guidance observer names, or solver-analysis call sites."}
|
||||
{"ts": "2026-04-29T10:20:00+00:00", "type": "process", "status": "accepted", "note": "When warned about imminent compaction, immediately write hot context from memory to a GUID-named scratch file before reading files or running commands. The trapdoor eats tidy workflows."}
|
||||
{"ts": "2026-04-29T10:23:52+00:00", "type": "verification", "status": "ok", "note": "Source hygiene audit read all 60 source files under src/scripts/tools/tests, removed stale GUI lattice_search event handling and outdated spec text, kept PhaseFieldSourceAnalysis only as a diagnostic gauge, aligned config/solver_params.json to the documented shipping basin, and passed the full pytest suite: 89 passed."}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
project:
|
||||
name: Repixelizer
|
||||
status: active
|
||||
phase: phase_field_stabilization
|
||||
phase: hosted_shipping
|
||||
premise: >
|
||||
Recover fake pixel art by inferring a real lattice and moving one
|
||||
displacement field under one coherent objective instead of piling up
|
||||
decorative solver machinery.
|
||||
Recover fake pixel art by inferring a real lattice and moving one explicit
|
||||
source-position field under a simple local flatness signal plus lattice
|
||||
coherence, instead of piling up compensating solver machinery.
|
||||
|
||||
objective:
|
||||
primary: >
|
||||
|
|
@ -13,76 +13,58 @@ objective:
|
|||
structure better than resize baselines on icons, emblems, logos, and simple
|
||||
sprites.
|
||||
current: >
|
||||
Keep the phase-field pipeline lean and coherent while improving the tracked
|
||||
sword-tip contour failure near tapered shapes without reviving optimizer
|
||||
sprawl.
|
||||
Ship the hosted experiment with the current usable explicit phase-field
|
||||
solver so Repixelizer stops blocking Heimdall and StreamPixels, while
|
||||
preserving clean state for later signal tuning.
|
||||
|
||||
constraints:
|
||||
- Prefer one field, one compact objective, and nearest-source final sampling.
|
||||
- Prefer one chosen ruler, one live position field, one direct signal, and nearest-source final sampling.
|
||||
- Use visible structure and focused fixtures, not just lattice proxy metrics.
|
||||
- Keep compare mode, diagnostics, tuning, and GUI observer surfaces working.
|
||||
- Avoid reviving trays, portrait layers, or multi-stage solver religions.
|
||||
- Avoid reviving trays, portrait layers, lattice phase, or multi-stage solver religions.
|
||||
- Treat hosted convenience as the product path; do not prioritize native desktop packaging unless it clearly beats hosted access on revenue, support burden, or strategy.
|
||||
|
||||
invariants:
|
||||
- The map is canonical and slow-changing.
|
||||
- Scratch is temporary and disposable.
|
||||
- Evidence is durable and distilled; routine activity logs belong in git history, diagnostics, benchmark artifacts, or commit messages.
|
||||
- The live pipeline is `source -> lattice inference -> edge analysis -> phase-field reconstruction -> cleanup -> optional palette fit -> diagnostics`.
|
||||
- The live pipeline is `source -> lattice inference -> diagnostic edge preview -> fixed lattice centers -> hierarchical flatness signal -> explicit local search plus lattice relaxation -> nearest source sample -> cleanup -> optional palette fit -> diagnostics`.
|
||||
- `phase-field` is the only live reconstruction engine.
|
||||
- The final image is emitted by nearest-source sampling from `uv0_px + disp_t`, not by bilinear output sampling.
|
||||
- The final image is emitted by nearest-source sampling from final source positions, not by bilinear output sampling.
|
||||
- If a change cannot be explained cleanly against `docs/lean-optimizer-algorithm-map.md`, it should not land.
|
||||
- Failed benchmark or regression fixes should be reverted before the next hypothesis.
|
||||
- Persistent state cruft is the same failure class as code cruft.
|
||||
|
||||
data_flow:
|
||||
observe:
|
||||
- task request
|
||||
- repository state
|
||||
- focused fixtures and diagnostics
|
||||
- algorithm map and implementation plan
|
||||
process:
|
||||
- rehydrate from canonical state
|
||||
- choose one bounded hypothesis
|
||||
- modify only the surface that deserves to exist
|
||||
- verify visually and numerically
|
||||
- distill belief-changing evidence
|
||||
- commit or backtrack
|
||||
cut:
|
||||
- revert failed code hypotheses immediately
|
||||
- reject proxy-only wins when the image got worse
|
||||
- trim duplicate or stale persistent notes instead of preserving them as fake continuity
|
||||
|
||||
active_subgoals:
|
||||
- Fix the tracked sword-tip contour widening without sacrificing the current internal linework win.
|
||||
- Improve along-stroke versus across-stroke behavior near tapered contours in a way that still fits the one-field optimizer model.
|
||||
- Ship the hosted experiment so Repixelizer unblocks Heimdall and StreamPixels.
|
||||
- Keep the current usable solver config stable unless launch exposes a blocking quality regression.
|
||||
- Keep inference, compare mode, diagnostics, tuning, and GUI observer events working after solver changes.
|
||||
- Preserve `source_structure` as a real objective signal instead of over-trusting lattice-only fidelity.
|
||||
- Keep Heimdall-backed hosted auth isolated to the web layer so future provider or session work does not contaminate self-host or solver code.
|
||||
|
||||
accepted_design:
|
||||
- `phase-field` in `src/repixelizer/phase_field.py` is the only live reconstruction engine.
|
||||
- The working pipeline is `source image -> lattice inference -> edge analysis -> phase-field reconstruction -> cleanup -> optional palette fit -> diagnostics`.
|
||||
- The working pipeline is `source image -> lattice inference -> diagnostic edge preview -> fixed lattice centers -> hierarchical flatness signal -> explicit local search plus lattice relaxation -> nearest source sample -> cleanup -> optional palette fitting -> diagnostics`.
|
||||
- `src/repixelizer/pipeline.py` owns orchestration and candidate rerank selection.
|
||||
- `src/repixelizer/analysis.py` provides the normalized edge scout used for loss and cleanup guidance.
|
||||
- `src/repixelizer/phase_field.py` owns the one honest optimization variable: `disp_t`.
|
||||
- Hosted demo jobs now use a direct autocorr lattice path: one consensus size, capped by the hosted output limit, with candidate rerank disabled.
|
||||
- `src/repixelizer/analysis.py` provides the normalized diagnostic edge preview used by observer/GUI/diagnostic paths; it does not steer the solver.
|
||||
- `src/repixelizer/phase_field.py` owns the live source-position field: initialize from fixed centers, choose local preferred positions from a 5x5 candidate window, blend toward them, relax lattice springs, then nearest-sample the source.
|
||||
- Hosted demo inference uses autocorr lattice candidates, capped by the hosted output limit, with low-confidence preview rerank available.
|
||||
- Hosted mode owns the public front door in `src/repixelizer/gui.py`: `/` is a landing page there, while local/self-host runs keep root as a plain redirect to `/app/`.
|
||||
- `src/repixelizer/access.py` now owns the hosted access seam: trusted-header ingress still works, `GC_ACCESS_MODE=heimdall` verifies Heimdall Ed25519 access tokens locally, and auth attempts are adopted into local httpOnly cookie sessions.
|
||||
- The optimizer starts from fixed lattice centers, uses a wider displacement budget than the earlier tighter leash, optimizes displacement with projected Adam, then rounds to real source pixels for final output.
|
||||
- `src/repixelizer/access.py` owns the hosted access seam: trusted-header ingress still works, `GC_ACCESS_MODE=heimdall` verifies Heimdall Ed25519 access tokens locally, and auth attempts are adopted into local httpOnly cookie sessions.
|
||||
- The solver starts from fixed lattice centers, adds tiny seeded noise, follows a direct hierarchical flatness signal, enforces local lattice coherence through spring relaxation, then rounds to real source pixels for final output.
|
||||
- Cleanup is local and secondary; it does not define the core reconstruction model.
|
||||
- `source_fidelity` is useful but incomplete; `source_structure` exists because visible structure can improve while lattice-only scoring complains.
|
||||
- The tracked badge fixture and sword-tip focus are the current reality check for solver changes.
|
||||
- Character glint/symbol cases, artificial focused cases, and the badge fixture remain useful reality checks for later solver tuning.
|
||||
- The algorithm map and forward plan must stay separate from scratch and evidence so the notes do not congeal into one giant lying blob.
|
||||
- The open-source distribution story is self-hosting; the paid offer is hosted convenience, not a desktop-app paywall.
|
||||
|
||||
landed_baseline:
|
||||
- Lattice inference with fixed or searched target dimensions and optional low-confidence candidate rerank.
|
||||
- Hosted demo inference uses a direct autocorr size pick instead of multi-size search, and it no longer silently pins unspecified jobs to `max_output_dimension`.
|
||||
- Edge analysis plus one displacement-field optimizer with projected constraints.
|
||||
- Lattice inference with fixed target dimensions or autocorr target candidates.
|
||||
- Hosted demo inference uses capped autocorr candidates and allows low-confidence preview rerank.
|
||||
- Diagnostic edge preview plus one explicit source-position solver with local search and lattice spring relaxation.
|
||||
- Compare mode, diagnostics writing, tuning, and GUI observer plumbing all working on the phase-field path.
|
||||
- `source_structure` reporting alongside `source_fidelity`.
|
||||
- Focus fixture `tests/fixtures/real/ai-badge-tip-focus.json` for the tracked tapered-contour blemish.
|
||||
- Hosted landing page and Heimdall auth seam in the web layer.
|
||||
|
||||
rejected_paths:
|
||||
- name: tray_optimizer_sprawl
|
||||
|
|
@ -93,7 +75,35 @@ rejected_paths:
|
|||
reason: stacked stages and compensators hide confusion instead of fixing the one-field model
|
||||
- name: projected_edge_spectrum_prior
|
||||
reason: the projected edge-energy spectral pass floor-hugged to 2px / 626-family aliases on the dense landscape fixture and did not justify its complexity
|
||||
- name: lattice_phase
|
||||
reason: lattice phase controls and search were removed; the live solver starts from fixed centers and moves the position field directly
|
||||
|
||||
current_status:
|
||||
summary: The repo has one live reconstruction engine, `phase-field`, wired through the main pipeline with lattice inference, edge analysis, projected displacement optimization, cleanup, optional palette fitting, diagnostics, compare mode, tuning, and GUI observer events. The searched lattice path now trusts autocorrelation only; it keeps a tiny near-best lag plateau and uses cross-axis consensus before collapsing to one lattice family. The hosted demo path now skips multi-size lattice search and candidate rerank entirely, taking one direct autocorr-consensus size and respecting the hosted output cap instead of silently pinning unspecified jobs to that cap. Hosted web access is now auth-landed without smearing into the solver: `src/repixelizer/access.py` verifies Heimdall Ed25519 access tokens locally, tracks auth attempts, and adopts local cookie sessions, while `src/repixelizer/gui.py` owns provider-start routes, direct backend callback receipt, the hosted landing-page login buttons, route guards, and queue/job ownership checks. Self-host remains permissive by default unless `GC_ACCESS_*` turns the seam on. The spectral prior experiment was removed after it floor-hugged to 2px / 626-family aliases on the dense landscape fixture, and the old change-interval / pixel-walk sizing path was cut after it kept pruning the badge away from the `126` family. The solver now has a wider displacement budget so moderate starting-grid error can be recovered by the field instead of requiring as much candidate-rerank ceremony. `source_structure` now rides alongside `source_fidelity` because lattice-only scoring was lying about visible quality. The tracked weakness is still the widened dark contour near the badge sword tip on tapered shapes.
|
||||
next_action: Resume manual tuning from `state/scratch.md`. Do not edit `config/solver_params.json` yet. Full-corpus validation picked `phase_field_local_search_radius_ratio=0.60` and `phase_field_local_search_blend=0.07`, but the regression guard found `0.50/0.07` and `0.55/0.05` may reduce known crisp-case regressions. Next run should full-validate those tighter/slower candidates against baseline before shipping params.
|
||||
summary: >
|
||||
The repo has one live reconstruction engine, `phase-field`, wired through
|
||||
lattice inference, diagnostic edge preview, explicit local-search reconstruction,
|
||||
cleanup, optional palette fitting, diagnostics, compare mode, tuning, and
|
||||
GUI observer events. Automatic lattice inference uses autocorr candidates;
|
||||
low-confidence autocorr candidates can be preview-reranked. Hosted web
|
||||
access is auth-landed without smearing into the
|
||||
solver: `src/repixelizer/access.py` verifies Heimdall Ed25519 access tokens
|
||||
locally, tracks auth attempts, and adopts local cookie sessions, while
|
||||
`src/repixelizer/gui.py` owns provider-start routes, direct backend callback
|
||||
receipt, hosted landing-page login buttons, route guards, and queue/job
|
||||
ownership checks. Self-host remains permissive by default unless
|
||||
`GC_ACCESS_*` turns the seam on. The solver is shipping with a usable but
|
||||
not final tuned config: local search radius `0.215`, blend `0.24`, move
|
||||
weight `0.09`, grid alignment `4.75`, signal energy power `1.4`, and signal
|
||||
peak power `3.25`, now aligned in `config/solver_params.json` and the docs.
|
||||
The source hygiene audit removed stale solver-analysis wiring, old GUI event
|
||||
names, fake cleanup prose, and outdated spec text while keeping diagnostic
|
||||
edge analysis as an observer/GUI gauge. The tuning pass proved that wide
|
||||
local-search windows caused neighbor feature poaching and that tighter radius
|
||||
plus stronger blend is the current motion-geometry basin. It did not fully
|
||||
retune signal knobs around that basin.
|
||||
next_action: >
|
||||
Ship the hosted experiment with the current usable solver config so
|
||||
Repixelizer stops blocking Heimdall and StreamPixels. Later tuning should
|
||||
start from `docs/solver-tuning-lessons-2026-04-29.md`: sweep signal knobs
|
||||
around `radius=0.215, blend=0.24` first, then movement/coherence knobs, then
|
||||
combinations, and only then run final full-corpus validation.
|
||||
|
|
|
|||
|
|
@ -1,75 +1,31 @@
|
|||
# Scratch: manual solver tuning in progress
|
||||
# Scratch: hosted shipping
|
||||
|
||||
## Current Subgoal
|
||||
Manual solver tuning is in progress; full-validate tighter/slower local search candidates before shipping params.
|
||||
Ship the hosted experiment path. Source hygiene is complete unless a fresh,
|
||||
concrete stale signature appears.
|
||||
|
||||
## Current bounded subgoal
|
||||
Find a shippable `config/solver_params.json` update for the simplified explicit phase-field solver. Do not resume random tuner blindly. Continue deliberate parameter nudging with benchmark evidence.
|
||||
## Completed in this cleanup pass
|
||||
- Removed unused old solver hyperparams from `src/repixelizer/params.py`.
|
||||
- Removed stale tuning-campaign knobs from `tools/solver_tuning_campaign.py`.
|
||||
- Removed `analysis` / `edge_map` from the live phase-field solver path.
|
||||
- Simplified `cleanup_pixels(...)` to alpha snap plus zero heatmap; the old iterative cleanup path was unreachable.
|
||||
- Updated tests that still passed `analysis` into the solver/candidate-selection path.
|
||||
- Renamed the live observer/GUI flatness artifact from `guidance` to `signal`.
|
||||
- Fixed the signal payload rename bug where the observer still copied stale `guidance`.
|
||||
- Reworded docs/state from `edge scout` / solver `guidance` to diagnostic edge preview plus hierarchical flatness signal.
|
||||
- Updated GUI event listeners from removed `lattice_search_*` events to the live `lattice_inference_*` events.
|
||||
- Reconciled `config/solver_params.json` with the documented shipping basin: `grid=4.75`, `radius=0.215`, `blend=0.24`, `move=0.09`, `energy=1.4`, `peak=3.25`.
|
||||
- Updated `docs/spec.md` so it describes the live explicit local-search solver and alpha snapping, not the removed autograd/projected-Adam solver.
|
||||
|
||||
## Baseline
|
||||
Current committed config before tuning:
|
||||
- `phase_field_local_search_radius_ratio`: `0.80`
|
||||
- `phase_field_local_search_blend`: `0.18`
|
||||
- `phase_field_signal_weight`: `0.25`
|
||||
- `phase_field_local_search_grid_weight`: `0.0`
|
||||
## Verification already run
|
||||
- AST parse across `src`, `scripts`, `tools`, and `tests`: passed.
|
||||
- Targeted stale-string scan for removed solver params, fake cleanup hooks, old guidance names, and solver-analysis call sites: clean.
|
||||
- Full source audit read 60 source files under `src`, `scripts`, `tools`, and `tests`; the only remaining `analysis=analysis` hit is the intentional `RunResult` diagnostic field.
|
||||
- Focused suite passed: `tests/test_pipeline.py tests/test_gui.py tests/test_inference.py tests/test_phase_field.py`.
|
||||
- Full suite passed: `89 passed`.
|
||||
- `tools/repixelizer_prepare_compaction.py`: 19 ok, 2 expected warnings, 0 errors.
|
||||
|
||||
## Timing / benchmark setup
|
||||
Manual batches use `run_roundtrip_benchmark(...)`, CPU, `steps=48`, `variants=1`, usually pinned ground-truth size (`infer_size=False`).
|
||||
Progress/log artifacts are under `artifacts/manual-tuning-*`, `artifacts/tuning-validation-01`, and `artifacts/tuning-regression-guard-01`.
|
||||
|
||||
## Key findings so far
|
||||
1. Blindly increasing signal made results worse.
|
||||
- `more-signal`: score `0.7339` vs baseline `0.6014` on 8-case soft+ai slice.
|
||||
- `signal-and-spring`: score `0.7090`.
|
||||
- Stronger attraction causes feature crowding / artifacts; do not chase bigger signal.
|
||||
|
||||
2. Increasing spring weight above current `4.0` did nothing on the slice.
|
||||
- `more-spring`: exactly same score as baseline.
|
||||
- Reason found in source: `_relax_lattice_springs_np` clamps spring step at `0.22`, and current `4.0` is already above the clamp threshold.
|
||||
|
||||
3. Smaller local search radius is the first real improvement.
|
||||
- 8-case soft+ai slice baseline: score `0.6014`, mean `0.3570`, worst `1.1717`.
|
||||
- `radius=0.60`: score `0.3746`, mean `0.2104`, worst `0.7575`.
|
||||
- Biggest wins were soft enemy cases that baseline lost to naive.
|
||||
|
||||
4. Slower local search blend improves further.
|
||||
- `radius=0.60, blend=0.10`: score `0.2804`, mean `0.1643`, worst `0.5513` on same slice.
|
||||
- Blend bracket showed `0.06`, `0.07`, `0.08` are basically a plateau.
|
||||
- Best small-slice objective: `radius=0.60, blend=0.07`, score `0.2687356`, mean `0.1616738`, worst `0.5185465`.
|
||||
- `radius=0.60, blend=0.08` is almost tied: score `0.2687747`.
|
||||
|
||||
5. Full-corpus validation across all 38 cases x soft/crisp/ai chose `radius=0.60, blend=0.07` over baseline and `blend=0.08`.
|
||||
- Baseline: score `0.7701765`, mean `0.4552439`, worst `1.5050192`.
|
||||
- `r060-b007`: score `0.5790363`, mean `0.2814493`, worst `1.2734060`.
|
||||
- `r060-b008`: score `0.5938681`, mean `0.2864235`, worst `1.3112390`.
|
||||
- `r060-b007` improved 97 / 114 rows, regressed 14 / 114, tied 3 / 114.
|
||||
- Mean deltas by profile: ai `-0.1981`, crisp `-0.1836`, soft `-0.1396`.
|
||||
|
||||
6. Known regression guard says `radius=0.60` still hurts specific crisp cases, especially `disciple` crisp.
|
||||
Full validation worst regression for `r060-b007`:
|
||||
- `disciple` crisp: row score `0.6688 -> 1.2734`, delta `+0.6046`.
|
||||
Other notable regressions:
|
||||
- `dagrons5-08` crisp: `1.1013 -> 1.2413`, delta `+0.1400`.
|
||||
- `dagrons5-10` ai: `0.8494 -> 0.9664`, delta `+0.1170`.
|
||||
|
||||
7. Regression-guard batch on the known bad cases prefers tighter radius.
|
||||
Cases: `disciple`, `dagrons5-08`, `dagrons5-10`, `dagrons5-11`, `9rpgenemies-02`, `9rpgenemies-06`, `minion`, `more-rpg-enemies-06`; profiles soft/crisp/ai; seed 23.
|
||||
- Guard baseline: score `0.8112430`, mean `0.5648541`, worst `1.3861505`.
|
||||
- `r060-b007`: score `0.6277928`, mean `0.3144768`, worst `1.3588636`.
|
||||
- `r055-b007`: score `0.5313045`, mean `0.3039784`, worst `1.0617322`.
|
||||
- `r050-b007`: score `0.4075140`, mean `0.2843421`, worst `0.6949151`.
|
||||
- `r055-b005`: score `0.4298573`, mean `0.2982637`, worst `0.7369090`.
|
||||
- `r060-b007-grid004`: score `0.6339122`, mean `0.3133518`, worst `1.3818866`.
|
||||
This means `r050-b007` or `r055-b005` need full-corpus validation before shipping. `r060-b007` is no longer automatically safe despite winning full validation, because the guard set exposes known bruises.
|
||||
|
||||
## Recommended next action after compaction
|
||||
Run full-corpus validation for:
|
||||
- baseline
|
||||
- `radius=0.60, blend=0.07` if not already using existing results for comparison
|
||||
- `radius=0.50, blend=0.07`
|
||||
- `radius=0.55, blend=0.05`
|
||||
- optionally `radius=0.55, blend=0.07`
|
||||
|
||||
Use all 38 cases, profiles `soft/crisp/ai`, seed `23`, steps `48`, CPU, pinned size. If `r050-b007` generalizes, it is the leading ship candidate. If it overfits the guard set, compare `r055-b005` and `r060-b007` on mean/worst/regression count.
|
||||
|
||||
Do not edit `config/solver_params.json` yet. The current best full-corpus validated params are `r060-b007`, but the regression guard has created a better hypothesis that still needs full validation.
|
||||
## Remaining notes
|
||||
- `PhaseFieldSourceAnalysis` intentionally remains as a diagnostic/GUI gauge for now. It does not steer the solver.
|
||||
- The remaining compaction warnings are expected: evidence ledger size, dirty worktree, and this scratch file existing.
|
||||
- Next real project move is shipping/commit hygiene and hosted deployment, not continuing this cleanup pass, unless a fresh scan finds a new concrete vestige.
|
||||
|
|
|
|||
Loading…
Reference in a new issue