Repository navigation
chore: Prune unread mask-rebuild counters and restated tests - #1236
Conversation
Drop counters nothing reads, a stale dead_code allow, a no-assertion Windows prompt test, and a timeout assertion already made next to it. Co-authored-by: Oded Messer <odedmesser@gmail.com>
omesser
left a comment
There was a problem hiding this comment.
Soft-gate (Architect) — CLEARED with Softs
Tip verified: 9efe777cce3a57d0331095769e12862f118c963e
Branch: cursor/prune-dead-code-and-tests-5092 → main
Hard axis: holds — no unique behavioural pin lost; unread mask-rebuild counters/attrs and assertion-free/duplicate tests only; FIDGET_TRACE_MASK_REBUILD print line kept on x11+windows (bench scripts parse it); production mask-rebuild / consent paths stay equivalent.
Soft ledger
| Soft | Status | Evidence |
|---|---|---|
| (a) CI green on tip | Met | PR Tests checks (ubuntu-latest) 110481039935, checks (macos-latest) 110481039659, windows 110481039988, renderer 110481039977 SUCCESS; Pages build 110481039369 SUCCESS; deploy 110481152187 SKIPPED — all on 9efe777c…. |
| (b) Scope / no unexpected behaviour change | Met | Diff is dead counters/attrs + five #[test] drops only (+2/−118). No production control-flow change beyond removing unread atomics beside the TRACE print. |
| (c) Spot-audit every removal | Met | See below — each drop has a named surviving seam or true deadness (rg on tip tree). |
| (d) Production path equivalence | Met | update_input_region / configure_overlay still re-exported from x11+windows; TRACE eprintln!("mask_rebuild: …") remains in both overlays; consent::usable → wanted still gates Linux list_window_titles and the frame-loop WindowNames path; no orphan read_mask_rebuild_stats exports. |
| (e) Merge hygiene | Met | Undrafted; mergeable=true, mergeable_state=clean. No Soft-conflict file overlap with open #1229/#1204/#1188/#689 on consent/platform/overlay/model paths. |
Soft (c) spot-audit
consent.rsdrop#[cfg_attr(target_os = "linux", allow(dead_code))]onwanted→ still live on Linux:usablecallswanted(consent.rs); Linuxlist_window_titlesgates viaconsent::usable(WindowNames, …)(platform.rs); frame loop usesconsent::usable(WindowNames, …)(frame_loop.rs). Attribute was stale, not the function.read_mask_rebuild_stats+MASK_REBUILD_*atomics (x11+windows overlays,platform.rswrappers, mod re-exports) →rgon tip: zero remaining callers/defs insrc-tauri/(and none inscripts/). Counters were write-only; measurement is the TRACE env print, which stays.FIDGET_TRACE_MASK_REBUILDprint kept → still present inplatform/x11/overlay.rsandplatform/windows/overlay.rs; bench scripts still export/set the env (scripts/bench-mask-rebuild-x11.sh,bench-gpu-compositing-linux.sh,bench-gpu-compositing-windows.ps1).mask_rebuild_stats_returns_valid_tuple(platform.rs) → assertion-free (called reader, discarded tuple); dead with the API.mask_rebuild_stats_readable_and_reset(x11+windows overlay tests) → tautological (two reads of never-incremented zeros); dead with the counters.windows_window_titles_prompt_is_noop→ no assert thatWindowsProbe::promptis empty. Surviving:windows_window_titles_always_granted,windows_live_probe_grants_window_titles,windows_usable_follows_wanted.a_model_api_turn_is_one_timeout_when_unset→ restatedtimeout_for() == TIMEOUTunder blank env. Surviving stronger pin:one_runaway_guard_caps_every_wake_on_every_host(assert_eq!(timeout_for(), TIMEOUT, …)plus host-cap asserts).
Soft-FIX
None.
Hard
Holds (Y). No unique behavioural pin lost; TRACE mask-rebuild line kept; consent wanted/usable production gates intact; unread counters and restated/assertion-free tests only.
— Cursor agent (Architect), on @omesser's behalf.
|
Isn't this removing foundations for benchmarking (mask rebuilds)? I guess they will be used again when we improve/benchmark iteratively, no? |
|
@omesser Short answer: no — this does not remove the mask-rebuild benchmarking foundation. What iterative benchmarking actually uses (kept)Bench / research measurement is the
So the path you will keep using when improving/benchmarking iteratively is still on tip. What this PR drops (was never the bench consumer)
So this is unused parallel instrumentation beside the live TRACE path, not the foundation the benches hang off. If we want in-process counters laterReintroducing two atomics + a small reader next to the existing Soft CLEARED at — Cursor agent (Architect), on @omesser's behalf. |
Why
Nothing a user sees changes. A mask rebuild still prints its line when
FIDGET_TRACE_MASK_REBUILDis set, which is what the bench scripts parse. The counters beside that print were never read, and five tests either asserted nothing, watched zeros, or repeated an assertion a stronger test already makes.Five
#[test]functions removed. 118 lines deleted, 2 added.What changed
consent.rswanted#[cfg_attr(target_os = "linux", allow(dead_code))].usablecallswantedon Linux (list_window_titles, the frame loop).platform/x11/overlay.rs,platform/windows/overlay.rsmask counters andread_mask_rebuild_statsplatform.rswrappers. Nothing read the counters. TheFIDGET_TRACE_MASK_REBUILDline stays.platform.rsmask_rebuild_stats_returns_valid_tupleplatform/x11/overlay.rs,platform/windows/overlay.rsmask_rebuild_stats_readable_and_resetconsent.rswindows_window_titles_prompt_is_noopWindowsProbe::promptis empty, and the test did not assert that.windows_window_titles_always_grantedstill checks the grant.model.rsa_model_api_turn_is_one_timeout_when_unsetone_runaway_guard_caps_every_wake_on_every_hostalready assertstimeout_for() == TIMEOUTafter the same default seed.No follow-up issues. Compile-time
Sendchecks, ignored desktop probes, and the rename-lever deletion already onmain(#1233) stay.How to verify
cargo test --workspace cargo clippy --workspace --all-targets -- -D warningsNo JavaScript changed, so
node --testis not part of this diff.cargo clippy --workspace --all-targets -- -D warningspassed here.cargo test --workspacepassed for every crate except threelinux_secret_servicetests, which need a Secret Service daemon and do not touch this diff.double_click_interval_ms_matches_gtk_settingspassed when run on the main thread.— Cursor agent, on @omesser's behalf.