The death writer is the wave branch's tick, not a missing half
Browse files at this commit56924e860c21822c2e8bbce6e42515f048e34ac1Parent: a091c6d- docs
- the death writer is the wave branch's tick, not a missing half
3 changed files +13 -8
- crates/app/src/notices.rs +6 -5
- crates/app/src/player/transport.rs +3 -2
- crates/app/src/tests/media.rs +4 -1
crates/app/src/notices.rsmodified+6 -5
| @@ -114,11 +114,12 @@ pub(crate) fn audio_step( | ||
| 114 | 114 | /// the caching; this owns the queue, so a test can drive both directions without |
| 115 | 115 | /// a window and without a device that dies on cue. |
| 116 | 116 | /// |
| 117 | -/// The reason itself is the engine's to write | |
| 118 | -/// ([`PlaybackSession::audio_disabled_reason`]): this side never spells its | |
| 119 | -/// words, so a lost-device reason the engine lane teaches the death path to set | |
| 120 | -/// needs nothing here -- and a death that sets nothing stays unsaid, which is | |
| 121 | -/// what the engine side of this defect is. | |
| 117 | +/// The reason is the engine's to write, and the engine's writer is the wave | |
| 118 | +/// branch's: `tick`'s dead branch sets the lost-device reason and `rearm_audio` | |
| 119 | +/// clears it (its own test observes both). This side is the reader and never | |
| 120 | +/// spells the engine's words, so the end-to-end flip is asserted on the merged | |
| 121 | +/// tree while this lane drives the same step through the seam below -- on this | |
| 122 | +/// lane's base engine no path flips the reason at all. | |
| 122 | 123 | pub(crate) fn audio_change_notice( |
| 123 | 124 | notices: &mut std::collections::VecDeque<SharedString>, |
| 124 | 125 | was: Option<&str>, |
crates/app/src/player/transport.rsmodified+3 -2
| @@ -36,8 +36,9 @@ impl Player { | ||
| 36 | 36 | /// A file that *opens* silent says so in its own open line |
| 37 | 37 | /// ([`audio_notice`], `library.rs`); what used to reach no consumer at all is |
| 38 | 38 | /// a reason that changes *under* a session that is already up. This is the |
| 39 | - /// reader of that state -- the writer of it is the engine's own | |
| 40 | - /// `PlaybackSession::audio_disabled_reason`, which this lane never spells. | |
| 39 | + /// reader of that state: the writer is the engine's (the wave branch's | |
| 40 | + /// `tick` dead branch sets the lost-device reason, `rearm_audio` clears it), | |
| 41 | + /// and this lane spells none of its words. | |
| 41 | 42 | /// |
| 42 | 43 | /// Called from [`Player::pump`] because that is the one place every frame |
| 43 | 44 | /// passes through, and written to cost an ordinary frame nothing: one read of |
crates/app/src/tests/media.rsmodified+4 -1
| @@ -20,7 +20,10 @@ use crate::notices::{audio_change_notice, audio_lost_line, audio_tail}; | ||
| 20 | 20 | /// saying so when it clears. This side is the *reader*: the writer of a reason is |
| 21 | 21 | /// the engine's own `audio_disabled_reason`, and the app's two call sites were |
| 22 | 22 | /// the *open* paths -- so a reason that arrived mid-session reached no consumer |
| 23 | -/// at all and the window played on in silence with nothing said. | |
| 23 | +/// at all and the window played on in silence with nothing said. The engine's | |
| 24 | +/// writer is the wave branch's, so the flip is driven through the seam here and | |
| 25 | +/// asserted end to end on the merged tree; nothing below depends on when the | |
| 26 | +/// engine's `tick` sets it. | |
| 24 | 27 | /// |
| 25 | 28 | /// Driven through the queue step itself -- [`audio_change_notice`] is the whole |
| 26 | 29 | /// of what a reason change does to the strip -- because a test cannot make a |