Repository navigation
Description
Context
Follow-up to #4707 and PR #4736. The user requested a durable checkpoint and pause before restarting their computer. The original memory regression remains unresolved; keep #4707 open.
Optimization checkpoint: checkpoint/esp32-flash-4707-unity, commit f29056fc18.
Complete resume notes: agents/tasks/esp32-flash-4707-resume.md.
Proposal
Resume reduction toward 3.10.3 while preserving the RMT rewrite and supported features. Reduce the excessive PR scope and restore larger unity groups where linker reachability permits. Investigate constant initialization and legitimate exception contracts rather than relying broadly on extra compilation units.
Saved candidate includes optional GPIO/ADC/PWM and power-indicator closure with single SDK-state ownership, explicit ISR ownership, and corkscrew/noise consolidated into existing graphics unity.
| Default Blink profile | Before GPIO | Checkpoint image flash | Static DRAM |
|---|---|---|---|
| legacy ESP32 | 274157 | 273173 | 17496 |
| modern ESP32 | 289923 | 289927 | 25036 |
| ESP32-S3 | 353591 | 353571 | 23416 |
Graphics consolidation alone preserved all three image totals. GPIO saves984 legacy bytes, costs4 modern bytes, saves20 S3 bytes; no DRAM change. These are controlled local candidate measurements, not exact reproduction of the user's PlatformIO figures.
Before this candidate, matched legacy Serial Blink still had26676 flash/248 DRAM gap versus3.10.3; modern public gist had21390 flash gap. Remeasure these identical controls rather than comparing unlike sketches.
Validation state
- GPIO candidate:323 native tests+95 examples passed; focused power/GPIO/ISR sanitizer tests passed; explicit legacy+modern SDK feature consumers compiled.
- Consolidated graphics:all three default Blink board builds and C++ lint passed; image totals unchanged.
- Full native consolidation run deliberately interrupted for requested restart. It must be rerun; it is not a completed validation pass.
- Published prior38bdb revision passed focused hosted run37675361815. Checkpoint has no hosted exact-SHA evidence.
- No hardware waveform/runtime claims; no production merge/release performed.
Acceptance criteria
- Fetch checkpoint and rerun full native plus focused sanitizers as needed; record genuine RED→GREEN evidence for any regression fixed.
- Remeasure matching 3.10.3 controls on unchanged sketch/toolchain/flags, including public gist pin12.
- Consolidate unnecessary optional unity boundaries; verify flash/RAM and actual optional-feature users after each change.
- Separate generic native-runner/AST tooling repairs into reviewable independent changes without losing complete cached-suite validation; preserve RMT-specific allocator test integration.
- Continue tracing residual linker roots/RMT storage and reduce the remaining gap to greatest viable extent without disabling supported behavior.
- Record exact-SHA hosted size evidence and applicable platform validation before claiming production readiness.
- Update ESP32 (Lolin D32): flash usage 2.5x higher in 3.10.6 vs 3.10.3 (+443 KB flash, +8 KB RAM) #4707 and PR fix(esp32): reduce default RMT flash and RAM overhead #4736 with measured results, residual costs and explicit limitations.
Decisions
- Preserve the optimization on a separate checkpoint branch, leaving existing PR source unchanged by this WIP snapshot.
- Pause now as explicitly requested; restart alone does not authorize resuming or merging.
- Preserve supported APIs, GPIO state ownership, allocation/lifetime behavior and complicated RMT functionality.
- Published Windows dependency reld0.2.3 remains unresolved. PRs reld220/221 exist, but merge/release permission is unanswered; do not publish a fictitious dependency pin.
Resume
git fetch origin, then git switch checkpoint/esp32-flash-4707-unity; read committed resume notes and CLAUDE.md. Use repository bash wrappers for all builds/tests/bloat. Local .build reports may survive reboot, but the committed notes and this issue preserve necessary measurements and open work.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Oct 7, 2026
Real
FL_NO_EXCEPTexperiment saved for resumption:experiment/esp32-noexcept-4707, commitdeedad18f3.The macro was globally a noop. Enabling real noexcept required declaration/definition/override and malformed-annotation compatibility repairs; this is an experimental branch, not production-ready global enablement.
Default Blink allocated flash, with the optional string group restored to STL unity:
A controlled four-way legacy snapshot measured the string unity restoration cost at 2,960 B with the noop versus 132 B with real noexcept. Later C++11 callback-alias compatibility repairs added 56 B to the final legacy image; the report preserves the distinction.
All three restored SDK Blink builds passed. Native debug tests for move (including noexcept static assertions), function, and string_search_a passed. Final lint still reports 25 findings; full native/example and hosted exact-SHA gates are outstanding. No hardware execution claimed.
Next: audit generic callback/visitor/allocator/Singleton constructor contracts, use real or conditional noexcept only where valid, reconcile matching C API/default-ctor declarations and lint expectations, then remeasure the safe subset before restoring more unity groups. One demonstrated retention root is SDK KEEP(.eh_frame), not Singleton alone. Keep #4707 and this follow-up open. Broader goal remains paused for the restart.