Severity: MEDIUM (latent) — patch_backup_header is a silent no-op against the pinned core; its unit test pins obsolete behavior; a related orchestrator define is now redundant.
Problem
crates/fbuild-library/src/library/ch32v_core.rs:197-228 string-replaces #ifndef CH32V00x in the downloaded core's backup.h. At the pinned commit (d767162), that file's guard is now:
#if !defined(CH32V00x) && !defined(CH32VM00X) && !(CH32X035)
so the replacement never fires (verified against the pinned file). It happens to be benign today because upstream now guards V00x/VM00X/X035 itself — but:
- The unit test
test_patch_backup_header_replaces_old_guard green-lights dead behavior (it feeds the function the old header text, which the pinned core no longer contains).
- The X035 workaround define
RCC_BackupResetCmd(x)=((void)0) in crates/fbuild-build-mcu/src/ch32v/orchestrator.rs:129-131 is now redundant (upstream's guard excludes X035 already).
- A patch that silently does nothing when its pattern is missing will hide the next core-pin bump's real breakage.
Fix direction
Either delete the patch + redundant define + obsolete test (preferred, since upstream fixed the guard), or make the patch return an error when its pattern is absent so a core-pin bump surfaces the drift. Verify the ch32v003/ch32x035 test envs still build after removal.
Acceptance
tests/platform/ch32v003 and tests/platform/ch32x035 build with the patch removed.
- No test asserts on behavior the pinned core can't trigger.
From the 2026-07-21 CH32V bench-readiness sweep.
Severity: MEDIUM (latent) —
patch_backup_headeris a silent no-op against the pinned core; its unit test pins obsolete behavior; a related orchestrator define is now redundant.Problem
crates/fbuild-library/src/library/ch32v_core.rs:197-228string-replaces#ifndef CH32V00xin the downloaded core'sbackup.h. At the pinned commit (d767162), that file's guard is now:so the replacement never fires (verified against the pinned file). It happens to be benign today because upstream now guards V00x/VM00X/X035 itself — but:
test_patch_backup_header_replaces_old_guardgreen-lights dead behavior (it feeds the function the old header text, which the pinned core no longer contains).RCC_BackupResetCmd(x)=((void)0)incrates/fbuild-build-mcu/src/ch32v/orchestrator.rs:129-131is now redundant (upstream's guard excludes X035 already).Fix direction
Either delete the patch + redundant define + obsolete test (preferred, since upstream fixed the guard), or make the patch return an error when its pattern is absent so a core-pin bump surfaces the drift. Verify the ch32v003/ch32x035 test envs still build after removal.
Acceptance
tests/platform/ch32v003andtests/platform/ch32x035build with the patch removed.From the 2026-07-21 CH32V bench-readiness sweep.