From ded14148f1d160776aaf3d648ecef048faaca037 Mon Sep 17 00:00:00 2001 From: JUAN JIANT Date: Thu, 5 Nov 2026 14:36:37 -0300 Subject: [PATCH] Pin the validated ADD draft layout and require ordinary builds; strengthen source-project preservation tests --- .github/workflows/voice-user-check.yml | 1 - docs/GENERATOR-DRAFT-SAVE.md | 7 + tests/song_draft_test.c | 12 +- tools/audio_layout.txt | 3587 ++++++++++++------------ tools/build.py | 3 +- 5 files changed, 1815 insertions(+), 1795 deletions(-) diff --git a/.github/workflows/voice-user-check.yml b/.github/workflows/voice-user-check.yml index ced4b37d..10ec750a 100644 --- a/.github/workflows/voice-user-check.yml +++ b/.github/workflows/voice-user-check.yml @@ -43,7 +43,6 @@ jobs: env: AC79_SDK: /home/runner/fw-AC79_AIoT_SDK JIELI_TOOLCHAIN: /home/runner/.jieli/toolchain - FELUCCA_REPIN: keep run: | mkdir -p build/song-check python3 tools/build.py > build/song-check/target.log 2>&1 || { diff --git a/docs/GENERATOR-DRAFT-SAVE.md b/docs/GENERATOR-DRAFT-SAVE.md index 44cecc7f..499b822b 100644 --- a/docs/GENERATOR-DRAFT-SAVE.md +++ b/docs/GENERATOR-DRAFT-SAVE.md @@ -40,6 +40,13 @@ with `FELUCCA_CONSOLE_VERBOSE=1`; their source is retained. Such builds still have to meet the target memory limits. No audio/IRQ optimization policy changes or memory-copy rewriting are used to make this release fit. +The linker now fills unused gaps with eligible main-loop functions as well as +UI tables and long UI-only strings. Interrupt-reachable code, fixed audio tables +and the radio object are excluded from code packing. Existing address, short-call +reach, application/segment size and RAM reserve guards remain mandatory. A +synthetic packing regression checks those exclusions and the audio anchors; +the final release must pass an ordinary build with its recorded layout. + Validation: native NOR tests cover source preservation, both scopes, same-project overwrite, failure/retry, project erase and dependent-row cleanup. Generator UI tests cover 45 genre choices, distinct parts, playback traversal, regeneration diff --git a/tests/song_draft_test.c b/tests/song_draft_test.c index e525bc4d..993d4807 100644 --- a/tests/song_draft_test.c +++ b/tests/song_draft_test.c @@ -24,6 +24,12 @@ static int saved_note(unsigned n,unsigned s) int main(void) { song_fixture(); + memcpy(draft_before,proj_slot,sizeof draft_before); + erase_error=1; + assert(song_draft_begin()&&!song_draft&&!memcmp(draft_before,proj_slot,sizeof draft_before)); + erase_error=0; + transport_req=1;assert(song_draft_begin()&&!song_draft);transport_req=0; + puts("draft: failed checkpoint and pending PLAY preserve the original workspace"); assert(!song_draft_begin()&&song_draft); memcpy(old_flash,nor+0x97000,sizeof old_flash); assert(st_load(OBJ_SONGIDX,&saved_index,sizeof saved_index)==sizeof saved_index); @@ -54,9 +60,13 @@ int main(void) puts("draft: same-project overwrite is explicit; failed saves retain the draft for retry"); assert(!song_erase_parts(1,0));for(unsigned n=0;n<4;n++)assert(saved_note(1,n)==-1); assert(song_draft&&!memcmp(draft_before,proj_slot,sizeof draft_before)); + assert(!song_erase_parts(song_cur,0)&&song_draft&&chain_config.count==4); + assert(!memcmp(draft_before,proj_slot,sizeof draft_before)); + for(unsigned n=0;n<4;n++)assert(saved_note(0,n)==-1); + song.playing=1;assert(song_select(3)&&song_draft);song.playing=0; writes=erases;assert(!project_erase(1));assert(!project_used(1)&&erases==writes); for(unsigned r=0;r