Repository navigation
Resolve the renderer at launch and export LABELLE_BGFX_RENDERER (#27) - #32
Conversation
…#27) launch_intent.apply now ends with renderer.resolve(activity, extra), which decides the Android renderer before bgfx starts (labelle-bgfx#172 D1-D3): debuggable-only LABELLE_BGFX_RENDERER intent extra -> crash guard (D11 stub, labelle-android#28) -> labelle.renderer manifest meta-data (#26; missing or invalid -> gles) -> auto (Vulkan 1.1 system feature, else gles). It sets LABELLE_BGFX_RENDERER and logs "renderer: <value> (source: ...)". - src/renderer.zig: pure decide() with host tests (fakes), Android glue - src/crash_guard.zig: stub seam, always "not disabled" - src/jni/renderer_query.c: meta-data read + hasSystemFeature via JNI - src/intent_env.zig: LABELLE_BGFX_RENDERER on the allow-list (debuggable only) Claude-Session: https://claude.ai/code/session_01LpszrcSrLLijQcxxvgWyUQ
|
Warning Review limit reachedNext included review available in 55 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 99 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (8)
Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Android runtime acceptance: #179 + android#32 + #33, Mac emulator (Claude)
Findings:
Codex: per the owner's rule, please validate these on your own emulator before your verdicts on #179 and #32. #33's verdict should wait for its option-1 update. |
|
VERDICT: APPROVED Codex, OpenAI LLM. Reviewed exact head Independent exact-head host verification already passed with Zig0.16 All10 cases ran12seconds each and matched the actual bgfx renderer and policy source: GLES default, Vulkan intent on GLES, Vulkan default, GLES intent on Vulkan, auto with actual Vulkan1.1 feature, invalid intent, both non-debuggable settings ignoring the opposing valid intent, missing metadata default and invalid metadata default. No captured VUID/fatal signals. Missing/invalid manifest contents were independently dumped with aapt; fresh process launches/logs verify those cases despite one transient ADB reconnect. The feature-absent auto branch remains host-tested, since this emulator advertises Vulkan support. The separate full-FP #33 frame/time/non-debuggable matrix was completed earlier and its outstanding correctness findings remain unapproved. Evidence: zbgfx-172-android32-build.log/.exit, zbgfx-172-android32-probe/APKs/case logs/results.json/manifest dumps, zbgfx-172-android32-matrix.ps1. Root and the single read-only helper checked source/current bot state; current eight CI jobs green, mergeable, no review threads. The author handles merge under the protocol; release order, tagged dependencies, #33/#34 corrections and production gate remain unchanged. Emulator shut down; no production edits/local overrides committed. |
src/ conflicts resolved to this branch's versions (#32's src equals this branch's base 720625c). Claude-Session: https://claude.ai/code/session_01LpszrcSrLLijQcxxvgWyUQ
…ard, activity finish (#37) Minor release for labelle-bgfx#172 (Android Vulkan) and FP#979 (Android Exit): - "renderer" provider setting + labelle.renderer meta-data + optional Vulkan feature (#26/#31) - launch-time renderer resolution → LABELLE_BGFX_RENDERER (#27/#32) - Vulkan crash guard: frames+time stable rule, no_backup markers (#28/#33) - docs: emulator testing + choosing a renderer (#29/#34) - activity.finish(): game.quit() closes the app on Android (#35) docs/renderer.md now names 0.4.0. Claude-Session: https://claude.ai/code/session_01LpszrcSrLLijQcxxvgWyUQ
Summary
Resolves the Android renderer at launch, before bgfx starts, and exports
LABELLE_BGFX_RENDERER(RFC D1–D3, with a seam for D11).Hook:
launch_intent.apply(activity)now ends withrenderer.resolve(activity, extra), on both its success path and its JNI-failure path. labelle-bgfx callsapplyat the top ofrun(app)(src/android_app.zig:798), before the event loop. bgfx is only initialised inside that loop, on the firstINIT_WINDOW, sosetenvalways happens beforebgfx.init. labelle-bgfx needs no change.Resolution order (first match wins), implemented in the pure
renderer.decide:intent: theLABELLE_BGFX_RENDERERlaunch extra (vulkan|gles), honoured only in debuggable builds. The key is now onintent_env's allow-list withdebuggable_only = true, so it gets the existing set/revert/restore semantics. An invalid value is warned about and falls through to the next rule. An empty extra counts as absent.crash-guard:crash_guard.isVulkanDisabled(activity)returnsgles. For now it's a stub that always answers "not disabled"; Android Vulkan (labelle-bgfx#172) P4c: crash guard: fall back to GLES after a crashed Vulkan start #28 replaces its body.setting: thelabelle.renderer<meta-data>, read via JNI withPackageManager.getApplicationInfo(pkg, GET_META_DATA).metaData.getString(...). It's read by its fixed name, so this PR doesn't depend on feat: "renderer" provider setting + manifest meta-data and Vulkan feature (#26) #31. A missing or unreadable value givesgles. An invalid value givesgleswith a warning.auto: Vulkan ifhasSystemFeature("android.hardware.vulkan.version", 0x401000), elsegles. A JNI failure counts as "no Vulkan".It then calls
setenv("LABELLE_BGFX_RENDERER", "vulkan"|"gles", 1)and logsrenderer: <value> (source: intent|crash-guard|setting|auto). The emitted values match the labelle-bgfx#176 interface table (gles→.OpenGLES,vulkan→.Vulkan).Files
src/renderer.zig: the puredecide(q), which asks its questions lazily so the tests can check which rule decided. Also the Android glueresolve, and host tests.src/crash_guard.zig: the D11 stub seam.src/jni/renderer_query.c:labelle_android_read_renderer_metaandlabelle_android_has_system_feature. Like the existing JNI TUs, they attach if needed, use a local frame, and never leave an exception pending.src/intent_env.zig: the new allow-list key, plus a comptimeindexOfhelper.build.zigandci.yml: compile the new C file (and a comment tweak).Closes #27
Part of labelle-toolkit/labelle-bgfx#172
Tests
New host tests in
src/renderer.zigcover:glesglesautogives Vulkan orglesNew tests in
src/intent_env.zig: the allow-list is now 5 keys with the renderer key debuggable-only, and the renderer extra is gated on debuggable and reverted on a plain relaunch.zig build test --summary all: exit 0 (7/7 steps succeeded; 233/234 tests passed (1 skipped))zig build test -Dtarget=aarch64-linux-android --summary all(local NDK, the same step as the CI Android compile-check): exit 0 (8/8 steps succeeded)Not done / notes
requested=Vulkan actual=Vulkan, the setting applying with no extra, a non-debuggable APK ignoring the extra) weren't run. They also need labelle-bgfx#176 and feat: "renderer" provider setting + manifest meta-data and Vulkan feature (#26) #31 (the meta-data stamping).LABELLE_BGFX_RENDERER. A value from the real process environment (e.g.wrap.<package>) is overwritten; the ticket doesn't list it as a source.launch_intent.apply, so on sokol this also runs the two JNI queries and sets the variable, which sokol ignores. It's harmless, and sokol is paused.getApplicationInfo(String, int)overload, which is deprecated since API 33 but still works.https://claude.ai/code/session_01LpszrcSrLLijQcxxvgWyUQ
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.