From 23d9f02e3a8060662d272c66a82bf16c9bd236c0 Mon Sep 17 00:00:00 2001 From: Will Temple Date: Sat, 16 May 2026 16:18:08 -0400 Subject: [PATCH] review pass the last --- lib/runtime/src/sys/macos/net.rs | 18 ++++++++++++++---- lib/ui_platform_macos/src/lib.rs | 7 ++++--- lib/ui_renderer_wgpu/src/lib.rs | 3 +++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/runtime/src/sys/macos/net.rs b/lib/runtime/src/sys/macos/net.rs index 081b2a0..a3a33a6 100644 --- a/lib/runtime/src/sys/macos/net.rs +++ b/lib/runtime/src/sys/macos/net.rs @@ -440,10 +440,12 @@ fn create_dns_pool() -> io::Result { .map(usize::from) .unwrap_or(2) .clamp(2, 4); + let mut spawned = 0usize; + let mut last_error = None; for index in 0..worker_count { let receiver = Arc::clone(&receiver); - thread::Builder::new() + match thread::Builder::new() .name(format!("ruin-runtime-dns-{index}")) .spawn(move || { loop { @@ -456,8 +458,16 @@ fn create_dns_pool() -> io::Result { Err(_) => break, } } - }) - .map_err(io::Error::other)?; + }) { + Ok(_) => spawned += 1, + Err(error) => last_error = Some(error), + } + } + + if spawned == 0 { + return Err(io::Error::other(last_error.expect( + "at least one DNS worker spawn should have been attempted", + ))); } Ok(BlockingPool { sender }) @@ -593,7 +603,7 @@ impl RawSocketAddr { sin_family: libc::AF_INET as libc::sa_family_t, sin_port: addr.port().to_be(), sin_addr: libc::in_addr { - s_addr: u32::from_ne_bytes(addr.ip().octets()), + s_addr: u32::from_be_bytes(addr.ip().octets()).to_be(), }, sin_zero: [0; 8], }; diff --git a/lib/ui_platform_macos/src/lib.rs b/lib/ui_platform_macos/src/lib.rs index 97bb279..4f9ec0f 100644 --- a/lib/ui_platform_macos/src/lib.rs +++ b/lib/ui_platform_macos/src/lib.rs @@ -460,6 +460,10 @@ pub fn run_macos_app_event_loop() { unsafe { let _: () = objc2::msg_send![app, run]; } + set_command_wake_hook(None); + if let Ok(mut slot) = run_loop_wake_handle().lock() { + *slot = None; + } } fn install_platform_run_loop_source() -> Option { @@ -1174,9 +1178,6 @@ fn drain_platform_commands(state: &Rc>) -> bool { let _: () = objc2::msg_send![app, stop: std::ptr::null_mut::()]; } set_command_wake_hook(None); - if let Ok(mut slot) = run_loop_wake_handle().lock() { - *slot = None; - } break; } } diff --git a/lib/ui_renderer_wgpu/src/lib.rs b/lib/ui_renderer_wgpu/src/lib.rs index 85cdc15..a991438 100644 --- a/lib/ui_renderer_wgpu/src/lib.rs +++ b/lib/ui_renderer_wgpu/src/lib.rs @@ -369,6 +369,9 @@ impl WgpuSceneRenderer { format, width: width.max(1), height: height.max(1), + // RUIN prioritizes immediate resize/input feedback over frame pacing + // here. Keep latency to one frame and let callers opt into a more + // power-conservative policy once presentation settings are exposed. present_mode: wgpu::PresentMode::AutoNoVsync, desired_maximum_frame_latency: 1, alpha_mode: caps.alpha_modes[0],