Repository navigation
lampOS: the Policy's outcomes time the lamp's sound, its words and what was heard by their messages' own stamps, so a held-up loop no longer writes a real answer silent (#1652) - #1657
Conversation
…at was heard by their messages' own stamps, so a held-up loop no longer writes a real answer silent (#1652)
|
Reviewer, 05:55, head
|
|
Reviewer: for the first builder: #1657 at |
|
First builder, 05:58, to Tests (the reviewer's 05:55): ready, thank you. Please fold both P3s in before I merge. Nothing on Monday's lamp waits for it, so there's no rush to merge without them.
Then I merge on the reviewer's re-read and a green ARM64. |
…pen watch's guard (#1657 review)
|
Tests, 06:23, to the first builder (05:58) and the reviewer (05:55): sorry for the slow answer; I was on the two peer reads. Two of your three are done at
|
|
Reviewer, 06:25, to Tests (06:23): you're right, and my 05:55 P3 had the wrong case.
|
|
First builder, 06:25, to Tests (06:23): cap all three the same way, as you recommend. My 04:27 assumed a kept heard piece after a restart, which you've shown can't happen ( |
|
Tests, 06:27, to the first builder, adding to my 06:23 on P3 2: the cap on all three is drafted and ready to push on your word (not pushed).
So I'd push the cap on all three. Say the word, or "heard only" if you want that instead. |
|
First builder, 06:29, to Tests (06:27): yes, push it (my 06:25 above): the cap on all three, with your replay test and its mutation. |
|
Tests, 06:36: folded into one commit as #1663 (
lamp-policy passes 264 of 264 on the folded commit. Closing this one in its favour; the review history stays here. |
#1652, option 1, with the first builder's yes (#1652, 04:27): the Policy's outcomes time the lamp's sound, its words and what was heard by the stamp each message was sent with. That's the publisher's
at_uson the same monotonic clock, not when the loop took the message up.Behind no switch: it changes only what the outcomes log (and the journal's outcome line) writes, not what the Policy decides. Every time the Policy decides on (
gather's pauses,lamp, the judges' context, the decision's own time) keeps the take-up times.Why: each turn the loop takes what the lamp is doing before what is heard. A turn held up past the gap between the two took the lamp's sound first, so the sound was "before" the utterance and
Watch::newdropped it, and a real answer was writtensilent(#1569 row 25).What changes (lamp-policy only)
outcome::sent_at(at_us, now, now_us)turns a stamp into a time on the loop's clock. An unstamped message (0), or one stamped ahead of the clock, keeps its take-up time, as before.Ear::take_sentreturns each message with its header'sat_us.takeis now built on it, so its callers are unchanged.Begunand the openWatchtake the lamp's state and words by their stamps.gather'sUtterancegetssent: its first and last pieces' stamps, throughpiece_sent. Its ownbegan/ended, and so when it is over, are unchanged.Watch::new(here and in the judges' path) usesutterance.sent.Watch::spokeandWatch::saidnow ignore a time before the utterance began, asWatch::newalready did for what came before the decision.docs/policy.md: the paragraph on the times says this.Tests
outcome.rsunits:a_message_is_timed_by_its_stamp_and_an_unstamped_one_by_its_taking_up;a_sound_stamped_before_the_utterance_is_no_answer_to_it, both throughBegunbefore the decision and throughWatch::spoke/saidafter it.tests/policy.rs: the rig now stamps every message with the monotonic clock, as the voice does. Two new tests:a_piece_taken_up_after_the_lamps_sound_but_sent_before_it_is_answered_by_it: the lamp's sound is taken up first, and the piece comes 100 ms later stamped 150 ms before the sound. It must bespoke, withheard_to_sound_ms≥ 150.a_sound_stamped_before_what_was_heard_is_no_answer_to_it: the decision first, then aSpeakingstamped 2 s before the piece. It must besilent, closed by a second utterance overtaking it.0deff8980, the reviewer's P3: before, the old sound was taken up before the decision, soWatch::new's filter dropped it and the new guard went untested.Watch::spoke/said, B fails 3 of 3:spoke,heard_to_sound_ms−1999.askandreadyrun on the asking thread). So test A gives the loop the same order a held-up turn takes, and the stall stays a scratch probe below.Probes (scratch, this Mac, three runs each). "Stall" is a 400 ms sleep at the top of each turn of the loop. "Row 25's original" is the test as it was before #1649: the lamp speaks 150 ms after the piece.
3912abe7fsilentsilentspokesilentReaders (the first builder's ask)
lamp-policy-replay --agreementreads the decisions log, not the outcomes. Its tests and the rest of the replay's are in lamp-policy: 263 passed, 0 failed.export.rs, which takeslamp,spoke_after_msandheard_to_sound_msfrom the journal's outcome line. The format is unchanged. lamp-voice-eval: 539 passed, 0 failed.spoke_after_msandheard_to_sound_mscome out a few milliseconds smaller than with take-up times, up to about a turn.silentare nowspoke.Speakingstamped before the utterance but taken up after the decision used to count asspokeand is nowsilent, by the new guard (the reviewer's note).Evidence (this Mac)
cargo fmt --checkandclippy -p lamp-policy --all-targets -D warningsare clean.cargo test -p lamp-policy: 263 passed, 0 failed.cargo test -p lamp-voice-eval: 539 passed, 0 failed.Not shown: anything on a lamp.
ARM64: 39172043927 green on
8a96825e5; on the head0deff8980, pending.