Repository navigation
Sweep dead code, redundant tests and superseded docs - #365
Merged
Merged
Conversation
jlipworth
force-pushed
the
chore/cruft-dead-code-sweep
branch
from
October 17, 2026 02:25
d197130 to
64c1b7f
Compare
This was referenced Oct 17, 2026
jlipworth
added a commit
that referenced
this pull request
Oct 17, 2026
#365 added a shared `XCTestCase.attachScreen(named:app:)` extension in `LabstreamTVUITests/XCTestCase+Screenshot.swift`; #367 kept an identical private copy in `LabstreamTVStatsTests.swift`. Together they break `LabstreamTVUITests` compilation on main ("overriding declaration requires an 'override' keyword"), which fails the `native-test-matrix.py` `tvos-build` lane (build-for-testing). CI does not currently build the tvOS UI-test target, so this merged green. Fix: delete the private duplicate; the shared extension is byte-for-byte the same body. Verification: `scripts/native-test-matrix.py affected --run --lane tvos-build` → TEST BUILD SUCCEEDED (run from the downloads-overhaul branch carrying the same one-file change).
jlipworth
added a commit
that referenced
this pull request
Oct 17, 2026
Second PR of the performance pass (UI and artwork). It stops off-screen browse work from fetching, decoding and animating. ## Changes - **Grid prefetch is tied to the placeholder's `.task`** (`LibraryGridView`, `MusicPagedGrid`, `ContainerBrowserView`). A fling now cancels the page prefetches for placeholders it scrolls past, instead of starting an unowned `Task` for every one. - **Lazy playlist rows:** the playlist track list and the music playlist list use `LazyVStack`. - **Skeleton shimmer:** - Skeletons lease the shared 60 Hz clock only after 300 ms, so cache hits and fast loads never start it. - Skeletons that don't hold a lease don't read the clock's phase, so they aren't invalidated on every tick. - The blurred backdrop washes in Detail and the music views show no shimmer. - `DEBUG || PERFORMANCE_AUDIT` counters emit `perf.shimmer_session`. - **Now Playing and mini bar:** the playhead tick now invalidates only the extracted scrubber and progress-hairline views, not the whole view. The Now Playing queue deliberately stays a `VStack` because its `scrollPosition` anchoring depends on it. - **Artwork memory pressure:** on a warning or critical memory-pressure event, the decoded-bitmap cache is emptied. Compressed bytes are kept, so the next read of an image whose bytes are still cached decodes locally with no network fetch. There is no epoch bump, so in-flight loads are unaffected. - **Docs:** `ARCHITECTURE.md` and `CODE-MAP.md` describe the trim, the delayed lease and the backdrop exemption. ## Measurements (visionOS worktree sim, Plex golden clone, 3 interleaved cold-launch pairs; full raw evidence kept privately) | `perf.shimmer_session` on Home | Baseline | After | |---|---|---| | Clock running | 788–804 ms | 77–109 ms | | 60 Hz ticks | 24 | 4–5 | | Leases | 38 | 7 | | Peak subscribers | 19 | 7 | `home.first_content` was unchanged (59–115 ms in both arms). The grid-prefetch cancellation, the lazy playlist rows and the Now Playing invalidation split are structural and were not timed in this pass. The memory-pressure trim is covered by a new `ArtworkPipelineTests` case: the read after a trim takes the compressed-cache decode path with no second network fetch. ## Verification - `ci-hygiene.sh`. - Hermetic PMSKit tests. - Clean builds: visionOS, iOS and macOS. tvOS is blocked by `main` (see below). - macOS hosted app tests. - visionOS worktree-sim smoke: install matches build, the app stays alive, and Home renders. ## Open gates - **Interactive checks:** fling, scrub and playlist scroll behaviour, and the music views on iPhone, iPad, tvOS and macOS, were not driven interactively. This is the user's half. - **Jellyfin/Emby:** blocked (no credentials). The changes are backend-agnostic UI code. - Physical-device performance and energy acceptance remain the maintainer's. - **tvOS build (pre-existing on `main`):** `tvos-build` fails on `origin/main` itself. Two PRs that merged close together collided: #365 added a shared `XCTestCase.attachScreen(named:app:)`, and #367 added a `private func attachScreen` in `LabstreamTVUITests/LabstreamTVStatsTests.swift`. This PR touches no tvOS file; the main app target compiles in the other three lanes.
jlipworth
added a commit
that referenced
this pull request
Oct 17, 2026
…#372) First PR of a bottom-up performance pass (networking/PMSKit). Static audit first, then before/after measurement where a harness exists. Results are unchanged; latency and the request pattern change. Probes now overlap, and discovery may contact up to four candidate servers at once where the serial walk contacted one. ## Changes - **Plex connection selection** (`PreferredProbe` in PMSKit, used by `AuthManager.firstReachable` and `discoverPlexSession`): probes still run concurrently, but the most-preferred reachable connection is returned as soon as every more-preferred one has failed, and the remaining probes are cancelled. Before, one dead LAN/IPv6 interface held sign-in/restore until the 3 s probe timeout. The preference order (local before remote, relay last) and the `machineIdentifier` check are unchanged. Candidate servers in discovery are probed the same way, at most 4 at a time and started in preference order. Servers beyond that window are never contacted once a winner is decided. - **Settings reachability:** all listed servers are probed concurrently. Each row updates as soon as its own probe finishes, and a newer check suppresses results from an older one. This is user-initiated and covers only the servers on screen, so it is not windowed. - **Collapsing Jellyfin/Emby grids** (`LibraryPagingModel.loadAllCollapsing`): later pages are fetched through a 3-page window and ingested strictly in offset order. The stale-generation guard, the empty-page stop and `serverTotal` handling are unchanged. A page's fetch error is surfaced only when ingestion reaches that page, so an error past an empty page is ignored and earlier pages are still ingested, exactly as in a serial walk. The load also re-checks that it is still current after the group finishes waiting for its cancelled fetches. - **Plex music home:** the history rail starts alongside the hubs (`async let`). - **Movie-version chooser:** labels are fetched concurrently and cancelled with the view. Also fixes a comment that already claimed this. ## Measurements (hermetic; full raw evidence kept privately) | Item | Before | After | |---|---|---| | Connection selection, fake probes (preferred 15 ms, two dead at 3 s, relay 120 ms) | ~3.1 s (3 runs) | ~12 ms, same winner, 3 probes cancelled | | Collapsing grid, 10 later pages at ~40 ms | 415 ms, max 1 in flight | 161 ms, max 3 in flight, same ingest order | The music history and version-label changes are structural (serial round trips become overlapped) and were not timed. ## Review round (gpt-6-astra, medium) An independent review found two major bugs in the first version of the paging window. Both are fixed in `ba539ec2`: - A load superseded while the group waited for its cancelled fetches could still mark itself complete. - A later page's error could end the load early. Three new `LibraryPagingModelTests` cases fail on the earlier version and pass now. The same commit adds the 4-server discovery window (with 2 new `PreferredProbeTests`) and the per-row Settings updates. ## Live A/B (macOS dev host, real servers; `main` vs this branch, alternating cold launches, 5 measured pairs per backend) - **Jellyfin collapsing Movies grid** (4 pages): full load median about 512 ms on `main` vs about 425 ms here, about 17% faster, and faster in every pair. The collapsed item count and alphabet rail are identical. - **Emby collapsing Movies grid** (4 pages on a LAN server, about 25 ms per page): no measurable difference. Results are identical. - **Plex session restore:** unchanged at about 3.1 s on both builds. The preferred server advertises a local connection that is unreachable from this host. Local connections rank first, so both builds wait out its 3 s probe timeout before using the remote connection, which answers in about 100 ms. The early return here only helps when the dead connection ranks *below* the winner. A follow-up that accepts a working lower-ranked connection without the full timeout is tracked separately. ## Verification - Hermetic PMSKit tests, including the new `PreferredProbeTests` (5). - `ci-hygiene.sh`. - Clean builds: visionOS, iOS and macOS. tvOS is blocked by `main` (see below). - macOS hosted app tests, including the new `LibraryPagingModelTests` cases (bounded window with in-order ingest; an empty later page stops ingestion). - visionOS worktree-sim smoke (Plex golden clone): install matches build, the app stays alive, and Home renders. `session.restore` and `home.first_content` are in line with baseline launches. ## Open gates - **Jellyfin/Emby live:** collapsing grid verified on the macOS dev host (see Live A/B). Not yet exercised on iOS, tvOS or visionOS hardware. - **Live Plex restore:** exercised on the macOS dev host. It is unchanged, for the reason given above. - Physical-device performance acceptance remains the maintainer's. - No player or transcode changes. `X-Plex-Client-Profile-Name=Generic` is untouched. - **tvOS build (pre-existing on `main`):** `tvos-build` fails on `origin/main` itself. Two PRs that merged close together collided: #365 added a shared `XCTestCase.attachScreen(named:app:)`, and #367 added a `private func attachScreen` in `LabstreamTVUITests/LabstreamTVStatsTests.swift`. This PR touches no tvOS file; the main app target compiles in the other three lanes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speculative cleanup sweep. 12 partitions were swept by Sonnet and Haiku agents (148 candidates), then an Opus verifier per partition tried to refute each one, which left about 55. Every change is a pure deletion or an equivalent dedup with no intended behaviour change. The net diff is about −11k lines, mostly archived docs.
Commits
PlaybackSeekControl,HomeRailsLoad,EpisodeResolver,directPlayStartM3U8Request(),uniqueExactIndex,LibraryVisibility.isHidden, unused enum cases (stallWatchdog,ambiguousCandidateCount), test-only SharePlay helpers, the duplicatequotewrappers and the test-only typealiases. Two members that only their own file used are nowprivate.X-Plex-Client-Profile-Name=Genericis untouched.PersistenceDurabilityTier. Every caller passed.bestEffort, soAppDiagnostics.flush()andappend(_:)lose the parameter.#if DEBUGlogDirectPlayDecision, the unusedmusicArtworkcallback kind, the unused debug-probe helpers, the unused Cinema geometry members and the unreferencedLabstreamLogo.imageset.RepeatMode.symbolNameand has search useformatTrackDuration.waitForObservedState,TestCounterand the gate helpers intoTestSupport.swift, adds a TV UI-test screenshot helper, and collapses the auth test gates into one held continuation.docs/archive/{plans,reviews,macos,proposals,first-public-cleanup}, most ofdocs/archive/researchanddocs/evidence/profiling, and the stray.claudecopy of theopenai.yamlagent metadata. It also repairs the links to them, de-duplicates the doc-lane taxonomy in README/index, and fixes small stale passages in DEVELOPMENT/CODE-MAP.loc.sh, de-duplicates the_sha256helpers intocontract.sha256_file, and adds a shared_script_loaderfor 8 tooling tests.PlexInsecureLANTrustDelegateremoved (maintainer decision): it was never installed.PMSKit.swift,SanityTests, the bump-version skill'stoolkitscope andpmskit-vtags, and the matchingRELEASES.mdlines.simclick.swift,click-login-jellyfin-tabinagent-sim-run.sh, the sim-driving skill and CLAUDE.md.RELEASES.mdrefreshed: the Cold launch without connectivity blocks completed offline downloads #259/iOS player chrome changes size or position between video aspect ratios #258 notes now say their fixes (Gate offline launch on a typed session-restore outcome (#259) #355/Keep iOS player chrome in one stable safe-area envelope (#258) #356) are onmainwith physical acceptance still open, and the outdated validation narrative is condensed.SharePlayReadinessSummary.canStart, so the tested policy is the one that runs. This doesn't change behaviour: the local participant is always.readyonceresolvedItemis set.Verification (local)
main.PATH=/usr/bin:$PATH scripts/ci-hygiene.sh: ok (strict MkDocs, links, mermaid, tooling tests).Labstream(visionOS),LabstreamMobile,LabstreamTV(build-for-testing) andLabstreamMac: all exit 0.native-test-matrix.py affectedlanes:Deliberately not changed
.envloader dedup acrossscripts/live-*.shpartly touches the download probes.Report-only (overlaps with active threads)
DownloadStore.createSeasonPlannedhas no callers,setPosterRelativePathis test-only, there are testing hooks in production sources, there is a stale "NOT live-verified" banner in the Plex optimize code, and theBackgroundQueue.first*accessors are test/probe-only. The Local* trickplay/chapter providers also duplicate boilerplate.