Summary
example/MnistExperiment.c no longer compiles against the current layer-init API. It is added to the build unconditionally (add_subdirectory(example) in CMakeLists.txt), but no CI job ever builds it, so the breakage is invisible and can rot indefinitely.
Reproduce
cmake --preset examples
cmake --build --preset examples # builds the default `all` target
Fails with:
example/MnistExperiment.c:134:48: error: too many arguments to function call, expected 2, have 6
example/MnistExperiment.c:137:33: error: too many arguments to function call, expected single argument 'lq', have 2 arguments
example/MnistExperiment.c:154:48: error: too many arguments to function call, expected 2, have 6
example/MnistExperiment.c:157:36: error: too many arguments to function call, expected single argument 'lq', have 2 arguments
Root cause
The layer constructors were refactored; the old names now take the new init/quant structs, and the previous signatures were renamed to *Legacy:
MnistExperiment.c calls |
Current API (src/userApi/layer/include/…) |
linearLayerInit(weight0, bias0, q, q, q, q) |
linearLayerInit(linearInit_t*, layerQuant_t*) — old form is now linearLayerInitLegacy(...) |
reluLayerInit(q, q) |
reluLayerInit(layerQuant_t*) — old form is now reluLayerInitLegacy(...) |
MnistExperiment.c was never migrated (last touched 2026-05-06, d3d9615, predating the refactor). It also still uses the deprecated tensorInitWithDistribution / tensorInitInt32 family (see #182).
Why CI doesn't catch it
unit_test* build presets target all_unit_tests, not all → they never build example/.
- The
examples CI job builds only --target train_c_har_classifier_v2 and --target train_c_ecg_anomaly_ae_v2, never the default all.
So the only way to hit it is a local cmake --build --preset examples with no --target.
Disposition (needs a decision)
examples/ (plural) has HAR and ECG demos but no MNIST, so this is the only standalone MNIST training example — deleting it drops MNIST end-to-end example coverage (the UnitTestMnistSmoke unit test would remain).
Options:
- Migrate
MnistExperiment.c to the current linearInit_t / layerQuant_t API (and the non-deprecated tensor-init calls), ideally folding it into the examples/ infra with a _shared-based harness like the HAR/ECG demos.
- Delete
example/ (singular) — accept losing the MNIST example; rely on examples/ as the canonical example location.
- Stopgap: mark the target
EXCLUDE_FROM_ALL (or gate add_subdirectory(example) behind a flag) so --build --preset examples stops failing, while leaving the migrate/delete decision for later.
Regardless of choice, consider having CI build the examples preset's default all (or whatever targets are meant to be supported) so a future example can't silently rot the same way.
Found while verifying the documented build presets.
Summary
example/MnistExperiment.cno longer compiles against the current layer-init API. It is added to the build unconditionally (add_subdirectory(example)inCMakeLists.txt), but no CI job ever builds it, so the breakage is invisible and can rot indefinitely.Reproduce
cmake --preset examples cmake --build --preset examples # builds the default `all` targetFails with:
Root cause
The layer constructors were refactored; the old names now take the new init/quant structs, and the previous signatures were renamed to
*Legacy:MnistExperiment.ccallssrc/userApi/layer/include/…)linearLayerInit(weight0, bias0, q, q, q, q)linearLayerInit(linearInit_t*, layerQuant_t*)— old form is nowlinearLayerInitLegacy(...)reluLayerInit(q, q)reluLayerInit(layerQuant_t*)— old form is nowreluLayerInitLegacy(...)MnistExperiment.cwas never migrated (last touched 2026-05-06,d3d9615, predating the refactor). It also still uses the deprecatedtensorInitWithDistribution/tensorInitInt32family (see #182).Why CI doesn't catch it
unit_test*build presets targetall_unit_tests, notall→ they never buildexample/.examplesCI job builds only--target train_c_har_classifier_v2and--target train_c_ecg_anomaly_ae_v2, never the defaultall.So the only way to hit it is a local
cmake --build --preset exampleswith no--target.Disposition (needs a decision)
examples/(plural) has HAR and ECG demos but no MNIST, so this is the only standalone MNIST training example — deleting it drops MNIST end-to-end example coverage (theUnitTestMnistSmokeunit test would remain).Options:
MnistExperiment.cto the currentlinearInit_t/layerQuant_tAPI (and the non-deprecated tensor-init calls), ideally folding it into theexamples/infra with a_shared-based harness like the HAR/ECG demos.example/(singular) — accept losing the MNIST example; rely onexamples/as the canonical example location.EXCLUDE_FROM_ALL(or gateadd_subdirectory(example)behind a flag) so--build --preset examplesstops failing, while leaving the migrate/delete decision for later.Regardless of choice, consider having CI build the
examplespreset's defaultall(or whatever targets are meant to be supported) so a future example can't silently rot the same way.Found while verifying the documented build presets.