Skip to content

The playback build/package matrix: PLAYBACK_BACKENDS selects both, uri, feed or none (P7) - #1276

Merged
GLinnik21 merged 6 commits into
mainfrom
uri-first/p7-backend-matrix
Nov 8, 2026
Merged

GLinnik21 merged 6 commits into
mainfrom
uri-first/p7-backend-matrix

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The URI and Feed backends are already two crates (plx_play_uri, plx_play_feed, #1274 and #1275). This PR makes the build able to
say which of them a binary contains, and records the drill that proved each one can be deleted. It changes no shipping behaviour:
the default is both, and both builds the binary main builds (Behaviour, below).

  • PLAYBACK_BACKENDS = both (default) | uri | feed | none (Makefile). One word, anything else is a parse-time error.
    It selects four things together, and keys the Cargo target directory so one value never reuses another's objects
    (make -s [RELEASE=1] PLAYBACK_BACKENDS=<v> print-playback-config prints them):

    value backend features native sources link libraries Starfish interposer export target dir (dev / RELEASE=1)
    both play-uri,play-feed all, incl. src/starfish.c -lplayerAPIs -lpf-1.0 yes target / target-release
    uri play-uri no src/starfish.c neither none target-uri / target-release-uri
    feed play-feed all -lplayerAPIs -lpf-1.0 yes target-feed / target-release-feed
    none none no src/starfish.c neither none target-none / target-release-none

    The dev set (devtools,devtriggers,threadcheck) is added when RELEASE is unset, and every build now passes --no-default-features
    with the backends named explicitly, so the stamp (pkg/.build-config) carries the feature list. none is not a television package:
    the Makefile refuses it at parse time, before the stamp reset, for every goal except check-nodef, clean and the side-effect-free
    queries (A television package requires a URI or feed playback backend; ..., make exit 2), so a refused make PLAYBACK_BACKENDS=none ipk leaves the previous build's stamp and outputs alone. make check-nodef PLAYBACK_BACKENDS=none type-checks the bare no-backend set.
    make check-nodef passes the selected set.

  • The stable and nightly ids ship both backends. release-guard refuses FLAVOR=stable|nightly with any PLAYBACK_BACKENDS other
    than both, so a single-backend binary can only ever be a dev (debug) build.

  • ELF gate. ci/check-elf.sh [binary [both|feed|uri]] (the mode defaults to $PLAYBACK_BACKENDS, else both). uri mode fails
    if the Feed interposer (callbackFunctionHook) is in .dynsym or in a relocation, or if libplayerAPIs/libpf stay in
    DT_NEEDED, and grades DT_NEEDED against the new ci/expected-dt-needed-uri.txt (13 entries: ci/expected-dt-needed.txt's 15
    without libpf-1.0.so.1 and libplayerAPIs.so.1). both and feed are graded against ci/expected-dt-needed.txt.

  • Package stamp. ci/check-package.py decodes pkg/.build-config against the Makefile's own flag strings for every backend the
    matrix builds (--print-build-config), and build-package.yml asserts the release build's stamp decodes as release. The grep that
    stood there (--no-default-features) passed for a dev build too once every stamp carried that flag.

  • Host tests. ci/test_sim_backend.py (new; in ci/check-python-steps.txt, so a make check step) holds the simulator's backend
    features; ci/test_arm_profile.py, ci/test_check_elf.py and ci/test_managed_targets.py gain the matrix cases, and
    ci/test_gen_notices.py pins that --verify-graph resolves the ARM graph with the Makefile's shipping feature set (asked of
    make print-playback-config) instead of a bare --no-default-features.

  • CI type-checks every value; it builds and packages only both. A new step in the host-checks job runs make check-nodef with
    PLAYBACK_BACKENDS=uri, feed and none, so a cfg(feature = ...) slip that breaks a single-backend build fails the PR. The ARM link and
    ELF gate of a variant stay local (ci/check-elf.sh is still called bare, mode both, at ci.yml and build-package.yml); the other
    workflow changes are the stamp decode in build-package.yml and host-lint's timeout-minutes 10 -> 20 for the three extra
    type-checks (to be re-measured from this PR's first CI timing). The variant links are in Verification and the drill record below.

  • The removal drill, recorded. docs/measurements/backend-removal-drill-2026-11-06.md: two disposable worktrees from 869ff76e2,
    one deleting rust-modules/play-feed/ (nofeed, URI survives, 52 files, 128bc3282) and one deleting rust-modules/play-uri/
    (nouri, Feed survives, 26 files, d17fe5b9d), each edited only in registrations (manifests, lockfile, layer table, Makefile, CI and
    tool lists, ledgers). Both survivors passed the whole sequence: zero diff in the shared crates (except the R-W5 dev-dependency lines),
    cargo tree free of the deleted crate, check-nodef, the lib tests (1,218 and 1,196 passed), check-module-layers, check-deps,
    the simulator targets, a RELEASE=1 ... ipk that passes check-package.py/check-packaged-elf.py (20,174,614 and 20,541,048
    bytes), and PLAYBACK_BACKENDS=none refusing. The doc also lists what failed or was left over. docs/uri-first-migration.md
    (new) is the staged-migration note that record belongs to.

  • Budget: binary_bytes 18,750,000 -> 20,000,000 (ci/build-budgets.json; the owner approved the raise for this series). Measured on
    this tree with ARM_PROFILE=release: the CI cross-build job's artifact (make ipk FLAVOR=debug, stripped, both backends plus the dev
    features) is 17,570,496 bytes, the shipping RELEASE=1 binary 16,091,088 bytes. Both are the same size as the corresponding
    origin/main builds (the raise buys headroom for the work after P7; the measured binary does not exceed main's 18,750,000). The
    file's measured / measured_on / headroom now say 17,570,496 / 2026-11-08 / 14%; main's 17,041,608 predates The URI backend returns as plx_play_uri: installed in the shipping binary, never selected, dev triggers back (P5) #1275.

  • The rest. ci/rust_toolchain.py (the Makefile's flag strings per backend), ci/mkmacapp.py, rust-modules/{README.md,Cargo.toml, media/Cargo.toml} and the .gitignore lines for the per-backend target dirs, AGENTS.md, docs/agent-reference.md, docs/uri-mode.md,
    .agents/skills/ui-sim/SKILL.md, .agents/agents/fw-compat-reviewer.md (now names ci/expected-dt-needed-uri.txt and
    PLAYBACK_BACKENDS / PLAYBACK_HAS_FEED), and the matrix prose. The audit round (below) touched docs/distribution.md and
    docs/hud-plugins.md.

Behaviour

  • The shipping binary is byte-identical in content to main's. Both built here with make ARM_PROFILE=release RELEASE=1 (the
    main side from a detached origin/main worktree, 3ae2ebfbb, with this checkout's staged vendor/ cloned in):

    origin/main 3ae2ebf this branch (1b0182b)
    pkg/plxnative 22,748,108 B, sha256 e7c77cd5...72a37 22,748,108 B, sha256 1d8ab8a0...9a4b
    stripped (strip --strip-unneeded, as make ipk stages) 16,091,088 B, sha256 fee0c739...0cad 16,091,088 B, sha256 ab42cf8c...a468
    pkg/.build-config features:--no-default-features --features play-uri,play-feed+tel:98c4b7d37a4c the same string, byte for byte

    The sha256 differ because build.rs embeds the short commit (PLX_BUILD_SHA, About screen): once per binary as a string and
    once as eight characters inlined by LTO into a movw/movt pair, plus the sha1 --build-id that hashes the file. With those two
    replaced by # (the build id zeroed), the two files are identical byte for byte, unstripped and stripped.

  • The default dev shape: same code, a different stamp spelling. make ARM_PROFILE=release + make ARM_PROFILE=release ipk FLAVOR=debug
    stages a stripped binary of 17,570,496 B on both sides (24,651,840 / 24,652,564 B unstripped). Their stamps differ on purpose:
    main writes features:+tel:98c4b7d37a4c (cargo's default features), this branch writes features:--no-default-features --features play-uri,play-feed,devtools,devtriggers,threadcheck+tel:98c4b7d37a4c (the same set, named explicitly). That spelling is
    not inert: --no-default-features removes the feature = "default" cfg from the application crate, so its symbol hashes change and
    LTO lays out .text 16 bytes smaller (file hashes differ, section sizes differ by .text -0x10, .ARM.exidx -0x30, .symtab/.strtab).
    To prove that is the whole difference, main's tree was rebuilt with the explicit flags (make RUST_FEATFLAGS="--no-default-features --features play-uri,play-feed,devtools,devtriggers,threadcheck" ipk): its stamp is identical to this branch's, and its binary differs
    from this branch's in 10 bytes, all of them the inlined build-sha immediates above (ebfb3ae2 vs 82b01b01, the two commits' hex
    characters), plus the build id. No code differs.

  • Nothing selects URI at runtime, unchanged from P5. The URI driver is installed on a normal boot and is never offered a source:
    the production qualifier answers Unknown, the evidence certifies no control, and BackendPolicy::choose() opens only a Qualified
    offer. This PR adds no call into that chain; rust-modules/src and the player crates are untouched, and the shipping binary above is
    the proof.

  • A uri binary links neither libplayerAPIs nor libpf, has no src/starfish.c and exports no Starfish interposer; it is a build
    matrix result, not a shippable configuration (nothing in the product selects it). A feed binary equals both minus the URI driver.

Content size (non-whitespace characters of the changed paths, origin/main -> branch)

Git reports 31 files changed (4 added, 27 modified; +1,255/-179 lines). The new docs are 29k of the 58k.

area changed paths before after delta
docs/ 7 506,284 535,920 +29,636
ci/ 14 224,785 248,618 +23,833
Makefile, AGENTS.md, .gitignore, rust-modules/README.md 4 199,246 202,126 +2,880
.agents/ 2 52,894 53,395 +501
.github/ (ci.yml, build-package.yml) 2 62,586 63,559 +973
rust-modules/Cargo.toml 1 20,400 20,435 +35
rust-modules/media (Cargo.toml) 1 4,823 4,798 -25

No Rust source changes; no C source changes.

Last of the series

With this PR, main holds the whole URI-first integration branch; nothing of it is left to carve. The files the older layout had
under rust-modules/media/src/ (the Feed's demuxer pieces and the three URI-probe files) were already removed by the earlier PRs.

Verification

Run on the committed tree (git status --short empty before and after each gate):

  • make check on the head, 4a4e362ac: 127 steps, all ok (309 s wall; the same on a53530023, 670 s wall); 43 libtest test result: lines, every one ok., 25,462 passed,
    0 failed, 198 ignored (several crates run under more than one feature configuration, so the sum counts some tests twice; the lines are per
    crate, never one total). Among them: plx_play_uri 203, plx_playback_contract 40, plx_platform 402, plx_play_feed 300,
    plx_media 1927 (84 ignored), plxnative-modules 1236, hostsim plx_media 2194 (84 ignored) and the application's hostsim suite 1419;
    tests/test_harness.py 722 tests OK. The same 43 lines on c4a4c6330, before the audit round (127 steps, 1333 s wall under load).

  • make check-nodef PLAYBACK_BACKENDS=both|uri|feed|none: all four rc 0 (uri checks only plx_play_uri, feed only plx_play_feed, none
    neither). bash ci/check-deps.sh: all gates green. ci/check-module-layers.py: 18 layers, 1,805 modules, green.

  • ARM links, ARM_PROFILE=release, on 1b0182b02 (the later commit changes only ci/build-budgets.json text), each followed by bash ci/check-elf.sh
    and python3 ci/check-build-budgets.py --binary <stripped binary>; every assertion of every ELF run passes (hook export or its absence in
    uri, exit interposer, 0 CP15 barriers, soft-float and libm, DT_NEEDED, storage helper 6 entries, no build-host paths):

    shape stamp features stripped unstripped DT_NEEDED (graded against) budget
    RELEASE=1 both play-uri,play-feed 16,091,088 22,748,108 15 (expected-dt-needed.txt) ok
    dev both (ipk FLAVOR=debug) play-uri,play-feed,devtools,devtriggers,threadcheck 17,570,496 24,652,564 15 (expected-dt-needed.txt) ok
    dev uri play-uri,devtools,devtriggers,threadcheck 16,643,640 23,361,452 13 (expected-dt-needed-uri.txt) ok
    dev feed play-feed,devtools,devtriggers,threadcheck 17,304,216 24,305,384 15 (expected-dt-needed.txt) ok
    RELEASE=1 uri play-uri 15,184,696 21,485,292 13 (expected-dt-needed-uri.txt) ok
    RELEASE=1 feed play-feed 15,894,432 22,489,516 15 (expected-dt-needed.txt) ok
    none - refused at parse time (make exit 2) before any build or stamp write; check-nodef only

    The budget is graded on the stripped binary against 20,000,000. The ipk FLAVOR=debug package of the dev shape also passes
    check-package.py and check-packaged-elf.py ("PASS actual IPK: 8 ELF files").

  • doc-claim-auditor on origin/main...carve/p7: 7 findings, the six that are prose fixed in 1b0182b02 / a53530023 (the SRCS
    comment, the Starfish-interposer sentences in the Makefile and ci/check-elf.sh, the check-nodef none sentence in the Makefile and
    docs/agent-reference.md, docs/distribution.md's stamp assertion, docs/hud-plugins.md's LIBS_REAL line number, and the
    binary_bytes baseline text); the seventh was the first commit's subject ("its CI variants"), which the CI step above now makes true. The two new docs were checked against the tree (cargo tree runs, commit stats, line
    numbers, print-playback-config, DT_NEEDED counts) with no contradiction found.

  • pr-reviewer on origin/main...carve/p7 (one round), fixed test-first: PLAYBACK_BACKENDS=none was refused in a recipe after the
    stamp reset had already run, so a refused ipk wiped the previous build's stamp (ci/test_arm_profile.py:: test_no_backend_cannot_produce_a_television_binary now asserts the stamp and RESET_PATHS survive pkg/plxnative, ipk and deploy;
    it failed before 2576f309e and passes after); CI type-checked no single-backend set (d33601ec7); nothing stopped a stable or nightly
    build with one backend (test_a_user_facing_flavour_ships_both_backends, 4 failures before 4a4e362ac, green after); the drill record
    now says its commits live on integ/uri-first.

  • fw-compat-reviewer: PASS. The shipping both ELF is unchanged and graded by CI as before; a uri binary's 13-entry DT_NEEDED is a
    strict subset of the shipping set. Follow-up it names: CI grades only the both ELF, so a uri package, if one ever ships, needs its
    own CI check-elf.sh uri gate first (today release-guard refuses one for the stable and nightly ids).

  • TV: not run, and not needed: no source in a shipped crate changed and the shipping binary is unchanged.

build-bench

make build-bench ARGS="--runs 3 --only noop,leaf,machine,platform,gfx,net,ui,plex,telemetry,data,session,media,appkit,screens,app,hub,tests,arm,sizes", base origin/main 3ae2ebf, head 4a4e362, one after the other on the same Mac (M4, 10 cores).

Scenario main 3ae2ebf median (min-max) P7 4a4e362 median (min-max)
No-op host test build 31.2 s (3.7 s-79.1 s) 38.5 s (0.1 s-47.6 s)
Edit leaf (plx_base cbuf.rs), non-incremental 56.8 s (54.8 s-89.2 s) 81.7 s (69.0 s-85.7 s)
Edit leaf (plx_machine landgate.rs), non-incremental 55.4 s (49.3 s-78.0 s) 55.8 s (54.9 s-64.9 s)
Edit leaf (plx_platform devcaps.rs), non-incremental 53.7 s (49.6 s-74.5 s) 53.8 s (52.8 s-59.4 s)
Edit leaf (plx_gfx overdraw.rs), non-incremental 35.5 s (31.7 s-87.4 s) 43.7 s (36.3 s-61.6 s)
Edit leaf (plx_net stream_redirect.rs), non-incremental 48.3 s (45.2 s-113.1 s) 61.0 s (50.0 s-73.8 s)
Edit leaf (plx_ui dwell.rs), non-incremental 33.4 s (31.3 s-60.5 s) 39.4 s (36.6 s-47.4 s)
Edit leaf (plx_plex retry.rs), non-incremental 47.3 s (43.0 s-83.7 s) 57.2 s (53.9 s-74.5 s)
Edit leaf (plx_telemetry window.rs), non-incremental 42.2 s (38.7 s-64.8 s) 48.1 s (45.0 s-61.4 s)
Edit leaf (plx_data tape.rs), non-incremental 46.8 s (36.9 s-55.0 s) 47.3 s (40.8 s-78.9 s)
Edit leaf (plx_session scripted.rs), non-incremental 29.7 s (27.9 s-36.5 s) 35.7 s (29.3 s-36.9 s)
Edit leaf (plx_media units.rs), non-incremental 36.8 s (31.7 s-47.7 s) 41.2 s (33.6 s-43.2 s)
Edit leaf (plx_appkit skip_pill.rs), non-incremental 31.3 s (27.8 s-37.4 s) 35.8 s (31.3 s-43.0 s)
Edit leaf (plx_screens clock_readout.rs), non-incremental 29.0 s (25.2 s-35.0 s) 30.2 s (29.5 s-34.2 s)
Edit leaf (app coldstart.rs), non-incremental 17.6 s (17.4 s-23.9 s) 21.4 s (18.6 s-26.8 s)
Edit hub (plx_ui lib.rs), non-incremental 24.5 s (24.4 s-28.6 s) 36.8 s (28.4 s-57.8 s)
Unit suite run (default features) 68.0 s (67.8 s-76.9 s) 70.9 s (69.4 s-72.6 s)
ARM staticlib rebuild (touch lib.rs) 20.0 s (17.3 s-81.8 s) 24.5 s (22.5 s-25.2 s)

Both runs warned that the host was loaded (load above the core count in several runs), so these timings are noisy. The head's
medians are higher in most rows, and the ranges overlap in most of them. Neither side measured a cause for the gap. What the two runs agree on is the shape:
every scenario rebuilt the same units out of 189, the unit suite passed the same 12,444 (0 failed, 99 ignored), and the ARM archive is 122.0 MiB
on both sides. The host test build's flags are not touched by this PR (RUST_FEATFLAGS is the ARM build's). The dev ARM build now
names its default feature set explicitly; that explicit spelling is the stamp difference described under Behaviour. Both sides flag the
no-op row as recompiling the app crate, so that predates this PR.

Related: #1064

🤖 Generated with Claude Code

GLinnik21 and others added 6 commits November 8, 2026 02:16
…iants and the backend-removal drill record

The tree is integ/uri-first's (bd398bd) exactly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r scope, check-nodef none, stamp decode, LIBS_REAL line ref)

doc-claim-auditor on origin/main...carve/p7, findings 2-5 and 7:
- Makefile SRCS comment: src/starfish.c is not built without a Feed backend.
- Makefile gc-sections comment and ci/check-elf.sh: the Starfish interposer is a Feed build's export;
  a uri build has none and check-elf's uri mode asserts it absent.
- Makefile check-nodef comment and docs/agent-reference.md: PLAYBACK_BACKENDS=none checks the bare
  no-backend set, not a single-backend set.
- docs/distribution.md: the RELEASE stamp assertion decodes the stamp, it no longer greps it.
- docs/hud-plugins.md: LIBS_REAL line number dropped (the matrix moved it).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…-11-08) and restate its headroom text

doc-claim-auditor finding 1: the measured/measured_on/headroom fields described a 17,000,000 -> 20,000,000
lineage and a 402 KB growth over main that this diff does not land on (main's limit is 18,750,000, and
plx_play_uri is already on main). Measured on this tree: `make ARM_PROFILE=release ipk FLAVOR=debug`
stages a stripped 17,570,496-byte binary, the same size as origin/main's own build.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…; host-lint timeout for the new step; the drill record names where its commits live

A recipe-level refusal ran after the parse-time stamp reset, so a mistyped
`make PLAYBACK_BACKENDS=none ipk` deleted the last real build's binary and staged
libraries before refusing. test_no_backend_cannot_produce_a_television_binary now
asserts the stamp and the reset paths survive pkg/plxnative, ipk and deploy; it
failed before the move and passes after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ightly ids

PLAYBACK_BACKENDS ?= both also reads the environment, so a leftover export could
turn make FLAVOR=stable RELEASE=1 ipk into a stable package with no Feed backend.
test_a_user_facing_flavour_ships_both_backends failed before the guard and passes after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 3309be0 into main Nov 8, 2026
25 checks passed
@GLinnik21
GLinnik21 deleted the uri-first/p7-backend-matrix branch November 8, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant