Skip to content

perf: SIMD loop optimizations and stream resolution stabilization#65

Merged
oguyon merged 1 commit into
framework-devfrom
perf/simd-and-error-handling
May 7, 2026
Merged

perf: SIMD loop optimizations and stream resolution stabilization#65
oguyon merged 1 commit into
framework-devfrom
perf/simd-and-error-handling

Conversation

@oguyon

@oguyon oguyon commented May 7, 2026

Copy link
Copy Markdown
Member

This PR stabilizes the cacao module ecosystem and aligns it with recent framework performance optimizations.

Key Changes

  1. Graceful Stream Resolution: Migrated stream resolution from ERRMODE_ABORT to ERRMODE_WARN across 26 files. This prevents the entire compute unit from aborting when encountering missing or disconnected streams.
  2. Safe Return Handlers: Added explicit NULL or RETURN_FAILURE checks in spotpos.c, AOloopControl_DM_comb.c, and DMturbulence.c after resolveIMGID calls, ensuring that stream failures propagate gracefully without segmentation faults.
  3. API Alignment: Updated the linopt_imtools_makeCPAmodes function calls in compute_control_modes.c and AOloopControl_computeCalib_loDMmodes.c to match the latest 19-argument signature introduced in milk's framework-dev branch, resolving standing compilation errors.
  4. Pointer Optimization: Injected MILK_RESTRICT and MILK_ASSUME_ALIGNED directives into hot loops within ao188_preprocessor.c to enable GCC auto-vectorization.

Testing

  • Fully compiled cacao and its plugins with make -j$(nproc) from the milk/_build directory.
  • Confirmed resolution of linopt_imtools_makeCPAmodes and RETURN_FAILURE type mismatch compiler errors.

Prompt Summary

The user requested the stabilization and performance hardening of the cacao plugin ecosystem, analogous to the optimizations recently deployed to milk. Specifically, the request entailed replacing ERRMODE_ABORT with ERRMODE_WARN, implementing graceful failure paths, and injecting SIMD pointer hints (MILK_RESTRICT / MILK_ASSUME_ALIGNED). After encountering build failures due to type mismatches and upstream API changes, manual compilation fixes were applied to restore the cacao build.

AI Authorship

  • Model(s) used: Antigravity
  • User edits: None

This commit stabilizes cacao by migrating from ERRMODE_ABORT to ERRMODE_WARN across 25+ files, and implements MILK_RESTRICT / MILK_ASSUME_ALIGNED to enable autovectorization in high-frequency module loops.
@oguyon oguyon merged commit bc65f06 into framework-dev May 7, 2026
1 check passed
@oguyon oguyon deleted the perf/simd-and-error-handling branch May 7, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant