Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
64bf371
test(render): checkpoint focused Native trails validation
jneerdael-netskope Oct 5, 2026
55ee02f
feat(render): add automatic Native core and trails
jneerdael-netskope Oct 5, 2026
a0f922e
test: retain verified focused matrix and unresolved visual findings
jneerdael-netskope Oct 5, 2026
18bd11b
test: select broad corpus risks for direct Mac GPU validation
jneerdael-netskope Oct 5, 2026
103dfdf
fix: review queued render allocations before publishing them
jneerdael-netskope Oct 5, 2026
c273b43
Merge remote-tracking branch 'origin/main' into feat/native-trails-pr…
jneerdael-netskope Oct 5, 2026
e6037d6
docs: record broad Mac results and post-merge fidelity research
jneerdael-netskope Oct 5, 2026
5074d66
docs: attach fresh build and shader link verification
jneerdael-netskope Oct 5, 2026
5067560
fix: reset FPS sampling for each completed render budget
jneerdael-netskope Oct 5, 2026
90845df
fix: clear render budget ownership when destroying the engine
jneerdael-netskope Oct 5, 2026
1cec55c
docs: replace retired sweep examples with automatic diagnostics
jneerdael-netskope Oct 5, 2026
f18a3f4
fix: preserve resident render budgets when allocations shrink
jneerdael-netskope Oct 5, 2026
a8a75f4
docs: describe live memory budgets without retired RAM caps
jneerdael-netskope Oct 5, 2026
19ae6e4
fix: scope focused validation to the captured Android user
jneerdael-netskope Oct 5, 2026
b8cf340
docs: explain scoped validation and immutable historical evidence
jneerdael-netskope Oct 5, 2026
8fc258a
fix(core): assess memory after reduced allocations render
jneerdael-netskope Oct 5, 2026
8bc3223
fix(core): retain pre-edit allocation across height callbacks
jneerdael-netskope Oct 5, 2026
3763293
docs: align current architecture with automatic native quality
jneerdael-netskope Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 14 additions & 21 deletions .github/scripts/publish_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,13 @@ def publish(repo, version, sha, notes, assets_dir, api=github_api, command=run):
body = notes.read_text(encoding="utf-8")
if not body.startswith(f"# ProjectM TV {version}\n"):
raise ValueError("release notes do not match the built version")
# Canonical core names remain the capped policy used by existing integrations and Milkbeat.
# The single Native core uses the canonical integration filenames.
pairs = [(f"projectM-TV-{version}.apk", "projectM-TV.apk"),
(f"projectM-TV-core-{version}.aar", "projectM-TV-core.aar"),
(f"projectM-TV-core-native-{version}.aar", "projectM-TV-core-native.aar")]
(f"projectM-TV-core-{version}.aar", "projectM-TV-core.aar")]
historical_native_pair = (f"projectM-TV-core-native-{version}.aar", "projectM-TV-core-native.aar")
mapping = f"projectM-TV-{version}-mapping.txt"
legacy_names = [name for pair in pairs[:2] for name in pair] + [mapping]
native_names = list(pairs[2])
names = [name for pair in pairs for name in pair] + [mapping]
digests = {name: hashlib.sha256((assets_dir / name).read_bytes()).hexdigest() for name in legacy_names}
for name in native_names:
if (assets_dir / name).is_file():
digests[name] = hashlib.sha256((assets_dir / name).read_bytes()).hexdigest()
digests = {name: hashlib.sha256((assets_dir / name).read_bytes()).hexdigest() for name in names}
for versioned, alias in pairs:
if versioned in digests and alias in digests and digests[versioned] != digests[alias]:
raise ValueError(f"latest asset alias differs from its versioned artifact: {alias}")
Expand All @@ -76,24 +71,22 @@ def publish(repo, version, sha, notes, assets_dir, api=github_api, command=run):
uploaded = set(assets)
# Older releases may not expose digest metadata. When available, check remote
# aliases too without replacing any published asset.
for versioned, alias in pairs:
for versioned, alias in [*pairs, historical_native_pair]:
first = assets.get(versioned, {}).get("digest")
second = assets.get(alias, {}).get("digest")
if first and second and first != second:
raise ValueError(f"published asset alias differs from its versioned artifact: {alias}")
if set(legacy_names + ["checksums.txt"]) <= uploaded and not set(native_names) & uploaded:
# Do not upgrade an already-complete legacy release to a new artifact schema.
return {"url": existing["html_url"], "created": False}
if not set(names + ["checksums.txt"]) <= uploaded:
required = set(names + ["checksums.txt"])
if set(historical_native_pair) & uploaded:
# Complete historical dual-policy releases are immutable too. A partial
# retired pair must never be mistaken for a complete single-core release.
required.update(historical_native_pair)
if not required <= uploaded:
raise ValueError("published release is incomplete; refusing to replace published artifacts")
for name in native_names:
if name not in digests:
raise FileNotFoundError(assets_dir / name)
return {"url": existing["html_url"], "created": False}
for name in native_names:
if name not in digests:
raise FileNotFoundError(assets_dir / name)
# Include versioned and stable aliases of both rendering policies, plus the R8 mapping.
if set(historical_native_pair) & {asset["name"] for asset in existing.get("assets", [])}:
raise ValueError("draft contains retired core-native assets; reconcile the draft before publishing the single-core schema")
# Include versioned and stable aliases of the APK/core, plus the R8 mapping.
checksums = assets_dir / "checksums.txt"
checksums.write_text("".join(f"{digests[name]} {name}\n" for name in names), encoding="utf-8")
names.append(checksums.name)
Expand Down
6 changes: 3 additions & 3 deletions .github/scripts/release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ def install_footer(repo: str, version: str, previous_tag: str | None, readme: st

Install on your TV with the Downloader app: code `{downloader_code(readme)}`. The code downloads the newest stable APK.

- Latest: [Android TV APK]({latest}/projectM-TV.apk) · [capped core AAR]({latest}/projectM-TV-core.aar) · [Native core AAR]({latest}/projectM-TV-core-native.aar)
- Version {version}: [Android TV APK]({release}/projectM-TV-{version}.apk) · [capped core AAR]({release}/projectM-TV-core-{version}.aar) · [Native core AAR]({release}/projectM-TV-core-native-{version}.aar)
- Latest: [Android TV APK]({latest}/projectM-TV.apk) · [Native core AAR]({latest}/projectM-TV-core.aar)
- Version {version}: [Android TV APK]({release}/projectM-TV-{version}.apk) · [Native core AAR]({release}/projectM-TV-core-{version}.aar)
- [SHA-256 checksums]({release}/checksums.txt)
- [User guide](https://johnneerdael.github.io/ProjectM-TV/)
- [Full changelog]({changelog})

The canonical core AAR uses capped rendering without feedback diffusion for Milkbeat and existing integrations. The Native core AAR enables feedback diffusion for eligible presets above the reference size."""
The canonical core AAR includes Native rendering for Milkbeat and existing integrations."""


def render_release_notes(repo: str, version: str, previous_tag: str | None, readme: str,
Expand Down
86 changes: 48 additions & 38 deletions .github/scripts/tests/test_publish_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def setUp(self):
self.notes = self.root / "notes.md"
self.notes.write_text("# ProjectM TV 2.1.5\n\nFixed a preset loading freeze.\n")
for name, data in {"projectM-TV-2.1.5.apk": b"signed apk", "projectM-TV.apk": b"signed apk",
"projectM-TV-core-2.1.5.aar": b"engine", "projectM-TV-core.aar": b"engine",
"projectM-TV-core-native-2.1.5.aar": b"native engine",
"projectM-TV-core-native.aar": b"native engine",
"projectM-TV-core-2.1.5.aar": b"native engine", "projectM-TV-core.aar": b"native engine",
"projectM-TV-2.1.5-mapping.txt": b"a.b -> x:"}.items():
(self.root / name).write_bytes(data)
self.commands = []
Expand All @@ -67,9 +65,8 @@ def upload(command):
self.assertIn(str(self.root / "checksums.txt"), command)
self.assertIn(str(self.root / "projectM-TV-2.1.5-mapping.txt"), command)
checksums = (self.root / "checksums.txt").read_text()
self.assertEqual(len(checksums.splitlines()), 7)
for name in ("projectM-TV-core-2.1.5.aar", "projectM-TV-core.aar",
"projectM-TV-core-native-2.1.5.aar", "projectM-TV-core-native.aar"):
self.assertEqual(len(checksums.splitlines()), 5)
for name in ("projectM-TV-core-2.1.5.aar", "projectM-TV-core.aar"):
self.assertIn(str(self.root / name), command)
self.assertIn(f"{hashlib.sha256((self.root / name).read_bytes()).hexdigest()} {name}\n", checksums)

Expand Down Expand Up @@ -135,43 +132,58 @@ def test_wrong_version_notes_are_rejected_before_network_calls(self):
self.publish(api)
self.assertFalse(api.calls)

def test_mismatched_capped_or_native_alias_is_rejected_before_network_calls(self):
for alias in ("projectM-TV-core.aar", "projectM-TV-core-native.aar"):
with self.subTest(alias=alias):
original = (self.root / alias).read_bytes()
(self.root / alias).write_bytes(b"stale engine")
api = FakeAPI()
with self.assertRaisesRegex(ValueError, "alias"):
self.publish(api)
self.assertFalse(api.calls)
(self.root / alias).write_bytes(original)

def test_new_release_requires_both_native_artifacts_before_writes(self):
for name in ("projectM-TV-core-native-2.1.5.aar", "projectM-TV-core-native.aar"):
with self.subTest(name=name):
original = (self.root / name).read_bytes()
(self.root / name).unlink()
api = FakeAPI()
with self.assertRaises(FileNotFoundError):
self.publish(api)
self.assertTrue(all(method == "GET" for _, method, _ in api.calls))
self.assertFalse(self.commands)
(self.root / name).write_bytes(original)

def test_complete_legacy_release_retry_needs_no_native_files_or_mutations(self):
def historical_dual_assets(self):
# Explicit immutable historical schema: canonical capped + opt-in Native artifacts.
(self.root / "projectM-TV-core-2.1.5.aar").write_bytes(b"capped engine")
(self.root / "projectM-TV-core.aar").write_bytes(b"capped engine")
(self.root / "projectM-TV-core-native-2.1.5.aar").write_bytes(b"historical native engine")
(self.root / "projectM-TV-core-native.aar").write_bytes(b"historical native engine")
return [{"name": p.name, "digest": "sha256:" + hashlib.sha256(p.read_bytes()).hexdigest()}
for p in self.root.iterdir() if p.name != "notes.md"] + [{"name": "checksums.txt"}]

def test_new_release_publishes_only_canonical_native_core_even_with_stale_alias_files(self):
self.historical_dual_assets()
for name in ("projectM-TV-core-2.1.5.aar", "projectM-TV-core.aar"):
(self.root / name).write_bytes(b"native engine")
self.publish(FakeAPI())
uploaded = {Path(arg).name for arg in self.commands[0] if arg.endswith((".aar", ".apk", ".txt"))}
self.assertEqual(uploaded, {"projectM-TV-2.1.5.apk", "projectM-TV.apk",
"projectM-TV-core-2.1.5.aar", "projectM-TV-core.aar",
"projectM-TV-2.1.5-mapping.txt", "checksums.txt"})
self.assertNotIn("core-native", (self.root / "checksums.txt").read_text())

def test_complete_historical_dual_release_retry_requires_no_retired_local_files_or_mutations(self):
assets = self.historical_dual_assets()
for name in ("projectM-TV-core-native-2.1.5.aar", "projectM-TV-core-native.aar"):
(self.root / name).unlink()
(self.root / "checksums.txt").write_text("historical checksum bytes\n")
legacy = ["projectM-TV-2.1.5.apk", "projectM-TV.apk", "projectM-TV-core-2.1.5.aar",
"projectM-TV-core.aar", "projectM-TV-2.1.5-mapping.txt", "checksums.txt"]
api = FakeAPI(existing={"id": 55, "draft": False, "assets": [{"name": n} for n in legacy],
"html_url": "legacy release"}, tag_commit="a" * 40)
api = FakeAPI(existing={"id": 55, "draft": False, "assets": assets,
"html_url": "historical release"}, tag_commit="a" * 40)
result = self.publish(api)
self.assertEqual(result, {"url": "legacy release", "created": False})
self.assertEqual(result, {"url": "historical release", "created": False})
self.assertFalse(self.commands)
self.assertTrue(all(method == "GET" for _, method, _ in api.calls))
self.assertEqual((self.root / "checksums.txt").read_text(), "historical checksum bytes\n")

def test_complete_single_core_release_retry_preserves_historical_checksum_bytes(self):
(self.root / "checksums.txt").write_text("historical checksum bytes\n")
names = ["projectM-TV-2.1.5.apk", "projectM-TV.apk", "projectM-TV-core-2.1.5.aar",
"projectM-TV-core.aar", "projectM-TV-2.1.5-mapping.txt", "checksums.txt"]
api = FakeAPI(existing={"id": 55, "draft": False, "assets": [{"name": n} for n in names],
"html_url": "historical release"}, tag_commit="a" * 40)
self.publish(api)
self.assertFalse(self.commands)
self.assertTrue(all(method == "GET" for _, method, _ in api.calls))
self.assertEqual((self.root / "checksums.txt").read_text(), "historical checksum bytes\n")

def test_draft_with_retired_remote_assets_is_rejected_without_writes(self):
api = FakeAPI(existing={"id": 55, "draft": True, "target_commitish": "a" * 40,
"assets": [{"name": "projectM-TV-core-native.aar"}]})
with self.assertRaisesRegex(ValueError, "retired"):
self.publish(api)
self.assertFalse(self.commands)
self.assertTrue(all(method == "GET" for _, method, _ in api.calls))

def test_partial_native_assets_cannot_be_treated_as_a_complete_legacy_release(self):
names = ["projectM-TV-2.1.5.apk", "projectM-TV.apk", "projectM-TV-core-2.1.5.aar",
"projectM-TV-core.aar", "projectM-TV-2.1.5-mapping.txt", "checksums.txt",
Expand All @@ -186,9 +198,7 @@ def test_partial_native_assets_cannot_be_treated_as_a_complete_legacy_release(se
def test_published_capped_and_native_remote_alias_digests_are_checked_when_available(self):
for alias in ("projectM-TV-core.aar", "projectM-TV-core-native.aar"):
with self.subTest(alias=alias):
assets = [{"name": p.name, "digest": "sha256:" + hashlib.sha256(p.read_bytes()).hexdigest()}
for p in self.root.iterdir() if p.name != "notes.md"]
assets.append({"name": "checksums.txt"})
assets = self.historical_dual_assets()
next(a for a in assets if a["name"] == alias)["digest"] = "sha256:" + "0" * 64
api = FakeAPI(existing={"id": 55, "draft": False, "assets": assets,
"html_url": "release"}, tag_commit="a" * 40)
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/tests/test_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,16 @@ def test_install_footer_uses_readme_and_versioned_and_latest_assets(self):
for url in (
"releases/latest/download/projectM-TV.apk",
"releases/latest/download/projectM-TV-core.aar",
"releases/latest/download/projectM-TV-core-native.aar",
"releases/download/v2.1.5/projectM-TV-2.1.5.apk",
"releases/download/v2.1.5/projectM-TV-core-2.1.5.aar",
"releases/download/v2.1.5/projectM-TV-core-native-2.1.5.aar",
"releases/download/v2.1.5/checksums.txt",
"https://johnneerdael.github.io/ProjectM-TV/",
"compare/v2.1.4...v2.1.5",
):
self.assertIn(url, result)
self.assertNotIn("4821216", result)
self.assertIn("capped", result.lower())
self.assertNotIn("capped", result.lower())
self.assertNotIn("core-native", result)
self.assertIn("Native core AAR", result)

def test_missing_canonical_downloader_code_fails_instead_of_stale_fallback(self):
Expand Down
27 changes: 21 additions & 6 deletions .github/scripts/tests/test_release_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def packaging_scripts(release):


class ArtifactPackagingTests(unittest.TestCase):
def test_native_core_is_saved_before_capped_build_overwrites_gradle_output(self):
def test_one_native_core_is_staged_under_canonical_name(self):
for release in (True, False):
with self.subTest(release=release), tempfile.TemporaryDirectory() as directory:
root = Path(directory)
Expand Down Expand Up @@ -61,12 +61,27 @@ def test_native_core_is_saved_before_capped_build_overwrites_gradle_output(self)
subprocess.run(["bash", "-eu", "-c", script], cwd=root, env=env,
check=True, capture_output=True, text=True)
suffix = "" if release else "-ci.42-abc1234"
capped = root / f"dist-aar/projectM-TV-core-2.1.5{suffix}.aar"
native = root / f"dist-aar/projectM-TV-core-native-2.1.5{suffix}.aar"
self.assertEqual(capped.read_bytes(), b"capped engine")
self.assertEqual(native.read_bytes(), b"native engine")
core = root / f"dist-aar/projectM-TV-core-2.1.5{suffix}.aar"
self.assertEqual(core.read_bytes(), b"native engine")
self.assertEqual((root / f"dist/projectM-TV-2.1.5{suffix}.apk").read_bytes(), b"native apk")
self.assertEqual(len(list((root / "dist-aar").glob("*.aar"))), 2)
self.assertEqual(len(list((root / "dist-aar").glob("*.aar"))), 1)


class CoreBuildPolicyTests(unittest.TestCase):
def test_cmake_rejects_retired_capped_policy_before_source_patching(self):
# Exercise the entry guard only: never configure or mutate the shared submodule.
source = WORKFLOW.parents[2] / "core/src/main/cpp/CMakeLists.txt"
guard = source.read_text().split("find_library(", 1)[0].split("project(projectmtv)", 1)[1]
with tempfile.TemporaryDirectory() as directory:
script = Path(directory) / "guard.cmake"
script.write_text(guard)
result = subprocess.run(["cmake", "-DPROJECTMTV_RENDERING_POLICY=capped", "-P", str(script)],
capture_output=True, text=True)
self.assertNotEqual(result.returncode, 0)
self.assertIn("retired", result.stderr.lower())
native = subprocess.run(["cmake", "-DPROJECTMTV_RENDERING_POLICY=native", "-P", str(script)],
capture_output=True, text=True)
self.assertEqual(native.returncode, 0, native.stderr)


if __name__ == "__main__":
Expand Down
Loading
Loading