Add an explicit hardware-smoke mode that negotiates pointer position and visibility feedback and fails while the host tracker is unavailable.
- commit
- 9215ed8d6d1d3790d46e61baa6450de8960931ed
- parent
- 190136519a33c2cd68e0318a70b89dcc5dcf8b69
- author
- Dami <dami.etoile@gmail.com>
| M | crates/ | 41 | +++++++++++++++++++++++++++++- |
@@ -103,6 +103,10 @@ struct Args {
103103 /// complete left-click. Intended for libinput/Gamescope-backed proof.104104 105105 pointer_smoke: bool,106+ /// Require the host to return an immediately available compositor pointer107+ /// position and visibility sample. Intended for Gamescope restart proofs.108+ 109+ pointer_feedback_smoke: bool,106110 /// Attach the media-feedback stream to the active session, submit one107111 /// complete report, and print the host's bounded decision. Intended for108112 /// validating shadow-only encoder configurations.@@ -1581,6 +1585,10 @@ async fn main() -> Result<()> {
15811585 if args.pointer_smoke {15821586 input_offers.push(Capability::RelativePointer);15831587 }1588+ if args.pointer_feedback_smoke {1589+ input_offers.push(Capability::PointerPositionFeedback);1590+ input_offers.push(Capability::PointerVisibilityFeedback);1591+ }15841592 if args.gamepad_smoke {15851593 input_offers.push(Capability::Gamepad);15861594 }@@ -1598,6 +1606,27 @@ async fn main() -> Result<()> {
15981606 session_id == input_negotiation.session_id,15991607 "media and input session IDs differ"16001608 );1609+ if args.pointer_feedback_smoke {1610+ ensure!(1611+ input_negotiation1612+ .capabilities1613+ .contains(&Capability::PointerPositionFeedback)1614+ && input_negotiation1615+ .capabilities1616+ .contains(&Capability::PointerVisibilityFeedback),1617+ "host did not accept the required pointer feedback capabilities"1618+ );1619+ let initial_feedback =1620+ read_expected_input_ack(&mut input_recv, args.timeout_seconds, 0).await?;1621+ ensure!(1622+ initial_feedback.pointer_position.is_some(),1623+ "host pointer feedback is unavailable"1624+ );1625+ ensure!(1626+ initial_feedback.pointer_visible.is_some(),1627+ "host omitted negotiated pointer visibility feedback"1628+ );1629+ }16011630 let input_started = Instant::now();16021631 write_input_event(&mut input_send, &InputEvent::Probe)16031632 .await@@ -2453,6 +2482,14 @@ async fn main() -> Result<()> {
24532482 "not-requested"24542483 }24552484 );2485+ println!(2486+ "pointer_feedback_smoke={}",2487+ if args.pointer_feedback_smoke {2488+ "ok"2489+ } else {2490+ "not-requested"2491+ }2492+ );24562493 println!(24572494 "gamepad_smoke={}",24582495 if args.gamepad_smoke {@@ -2752,7 +2789,7 @@ async fn read_expected_input_ack(
27522789 recv: &mut iroh::endpoint::RecvStream,27532790 timeout_seconds: u64,27542791 expected_sequence: u64,2755-) -> Result<()> {2792+) -> Result<sigil_protocol::InputAck> {27562793 let input_ack = tokio::time::timeout(27572794 Duration::from_secs(timeout_seconds.min(5)),27582795 read_input_ack(recv),@@ -2765,7 +2802,7 @@ async fn read_expected_input_ack(
27652802 "unexpected input acknowledgment sequence {}; expected {expected_sequence}",27662803 input_ack.sequence27672804 );2768- Ok(())2805+ Ok(input_ack)27692806 }27702807 27712808