Commit 9e7dd20
Fix Rust convergence bug: compare smoothed vs previous target, not current
The convergence check compared smoothed values against the current tick's
target, which gets overwritten by process_brightness/process_audio before
the check. With noisy camera readings the target fluctuates each tick,
preventing convergence. Now saves previous targets before processing and
compares against those — matching the Python version's behavior.
Also fixes v4l2 capture_frame requiring &mut self for MmapStream::next().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent e1fa9be commit 9e7dd20
File tree
3 files changed
+11
-7
lines changed- adaptive-rust
- crates/bin/src
3 files changed
+11
-7
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
| |||
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
177 | | - | |
| 181 | + | |
178 | 182 | | |
179 | | - | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
347 | 351 | | |
348 | 352 | | |
349 | 353 | | |
350 | | - | |
| 354 | + | |
351 | 355 | | |
352 | 356 | | |
353 | 357 | | |
| |||
0 commit comments