Repository navigation
fix(tv): stop the hero backdrop banding on dark art - #1015
Conversation
On Android TV Home the hero backdrop showed visible gradient steps on a dark OLED, in two places: - Where the art fades into the colour wash, next to the title logo. The art was masked in an offscreen layer with two DstIn alpha ramps. The GPU dithers colour but not alpha, so the layer stored art x fade rounded to whole 8-bit levels, and every level the fade crossed showed as a contour. - Across the whole wash on Android 9. Its GPU path doesn't dither gradients and interpolates multi-stop gradients through an 8-bit colour table, so the dark diagonal wash, which spans few levels across the screen, fell into flat bands. Android 14 dithers it already. The art now draws whole, and the page's own wash is painted over its box through a fixed corner-fade mask in a single ComposeShader draw, above every crossfade slot. Each pixel is art x fade + wash x (1 - fade), worked out at full precision and rounded once. Pages that never show art (Calendar) skip that draw. On Android 9 and later the wash is worked out on the CPU and drawn from two 8-bit strips the GPU interpolates in floating point: whole levels and the fraction of a level x 255. The fraction and a noise tile are scaled back down in the shader and added before rounding, so every level is dithered, with no half-float textures (Android 9 reads those as linear light, and GLES 2 TVs may not filter them). The ramp sits half a level low so the dither averages to the wash's own tone. Bitmap shaders are asked for bilinear sampling, which Android 13 and later need inside a ComposeShader. A flat wash (no tint yet) gets no noise, keeping OLED black black. Below Android 9 the wash stays a plain gradient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review Summary: ✅ CompletedThis 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. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The Evidence section says publishing is pending but provides no captures or evidence link. The emulator validation description does not let reviewers see the change without building the branch. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
The evidence is published now and linked in the description's Evidence section: before-and-after captures of the same Home hero and items on Android TV (Android 9 and Android 16 emulators) and Calendar, with the build and commit for each, plus browsing recordings. 🤖 Claude Code in T3 Code (claude-opus-5-5) |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed ee116e9)
Two findings, both on lines in this diff. I reviewed only commit ee116e9.
- C1 (important). On Android 12 and 12L (API 31–32), every bitmap shader nested in a
ComposeShadersamples the nearest pixel.filterModedoesn't exist there, so the gate at API 33+ can't fix it. The 256×256 fade mask gets stretched over the art box in blocks of about 5×3 px, which can bring back contour lines in the art fade on those versions. Neither version was measured. - C2 (nit). On API 28+, the tint-only and empty washes are now noise-dithered, so the older
DitheredWashOverlaygrain is no longer needed there. It also lifts black by more than the noise this PR avoids for that reason.
Otherwise the approach holds up. I checked the ramp matrix projection, the texel-edge mapping of the mask, the noise anchoring between the page wash and the art fade (same pixels on both), the half-level bias against round-to-nearest output, MULTIPLY/ADD alpha with opaque inputs, and caller behaviour on Home, Requests, and Calendar. I found nothing wrong in any of them.
🤖 Written by an AI reviewer (Claude Opus 5.5).
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gemini-4-neon, reviewed ee116e9)
Two findings verified against the diff and AOSP graphics source:
- High (
G1, line 433): Android 12 and 12L (API 31–32) hit the same AOSPComposeShadernearest-neighbor sampling bug seen on Android 14/16, beforeBitmapShader.setFilterModeexisted in API 33 — visibly stair-steppingCornerFadeMask(256×256) across the art fade and dropping bilinear filtering onwashRamp. - Medium (
G2, line 483):smoothedWashStopsstill double-rounds all 7 wash stops through 8-bit sRGBColorviatint.copy(alpha = alpha).compositeOver(background), introducing up to 0.60-level stop error (0.47 vsmain) and multi-hundred-pixel flat plateaus on dark washes such as Calendar (#14365A).
Checked and confirmed sound: API 24–27 legacy HWUI ComposeShader(LinearGradient, BitmapShader, DST_IN) support and GL_LINEAR filtering (libs/hwui/SkiaShader.cpp / ProgramCache.cpp), rampMatrix and CornerFadeMask edge alignment, IGN noise bounds (0..254, mean 127.08), and all five TV callers (TvSkylineSectionFeed for Home / For You / library Recommended, TvCalendarScreen, TvRequestsPage) including spoiler hiding and crossfade ordering.
AI disclosure: Automated adversarial review generated by gemini-4-neon.
Review follow-ups for the hero backdrop banding fix: - On Android 12 and 12L a bitmap shader inside a ComposeShader samples the nearest pixel, and the setting that asks for bilinear only arrived in Android 13, so the 256x256 fade mask would have stepped every few pixels across the art's fade. From Android 9 the fade is now two two-stop gradients multiplied together, which every GPU works out exactly; the bitmap mask stays only below Android 9. - The wash stops were blended into 8-bit Compose Colors before the ramp interpolated them, rounding each stop by up to half a level and leaving flat stretches on dark washes. They're now blended in floating point. - From Android 9 the tint-only and empty washes are dithered in the shader, so the white grain overlay only lifted an OLED's black there; it now draws only below Android 9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
…ds-framed-hero Main's #1015 conflicts in TvRootHeroBackdrop.kt. Take its grain rule (white grain only on tint-only and empty washes below Android 9; the shader dithers the wash from Android 9), dropping this branch's grain behind art. #1015 also paints the wash over the art box once above every art slot, which would fade the framed cover's leading and bottom edges, shadow and glow. Draw corner art and framed covers in two crossfades with the same timing, the corner art under the fade and the cover above it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Related issue: N/A
Validation tasks: unavailable (the validation board couldn't be read from this run; see Validation)
Other clients: Apple Silo-Server/silo-apple#1239; Roku N/A (draws its hero scrims from pre-rendered images, so neither Android graphics behaviour behind this applies); Web N/A (the browser renders and dithers its own gradients)
On Android TV, the Home hero backdrop shows visible gradient steps on a dark OLED in a dark room. There are two causes:
Home, For You and library Recommended share this hero, and Requests uses it too. Calendar shows the wash without art, and its wash gets the same dithering.
Approach
Only
TvRootHeroBackdrop.ktchanges. Geometry, tones, the 500 ms tint and art crossfades, spoiler handling and the first-frame snap are unchanged. Calendar skips the overlay because it never shows art; its wash is dithered like the others and loses the white grain on Android 9 and later. The phone app is unaffected because it has its own hero.Validation
4b563c4b5) installed back to back on the same items (Terminator 2, Prometheus) and Calendar.4b563c4b5.:androidTvApp:assembleDebug,:androidTvApp:lintDebug(no errors; oneUseKtxwarning matching the file's existingBitmap.createBitmapcalls) and:androidTvApp:testDebugUnitTest(1409 tests, 0 failures). One unrelated sign-in test,TvAuthSingleFlightTest, failed once on a test-dispatcher race (Dispatchers.Main is used concurrently with setting it) and passed on four reruns. No test was added: per this repository's testing rules, UI rendering is shown by the captures.read:projectscope, so I couldn't check passed validation cases.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-1015/
Surface and build: Android TV emulators, API 28 and API 36, 1920×1080; main
1b4732d90against this branch. The phone, tablet and foldable are unaffected, since every change is in the Android TV app.Risks
Follow-ups
TvDetailHero.ktfades its backdrop with the same offscreen-layer masks, so detail pages likely show the same contours. Not checked here.Council review
Three members, each on a different provider: Codex
gpt-6.2-sol(attack, xhigh), Claudeclaude-opus-5-5(cut, high) and Antigravitygemini-4-neon(premise check, xhigh).Visual review of the final captures:
Open notes from the visual review, none blocking:
Background adversarial review, round 1 on
ee116e9:4b563c4b5. A2 and A3 accepted: a 500 ms transient that main also has, and a redraw of wash over wash with no visible effect. Not posted on the PR: the tool couldn't set the review's commit.4b563c4b5.4b563c4b5. G1's strip part answered in its thread, which is left open: about 0.02 levels per texel; the platform-gradient gate on Android 12+ isn't adopted because Android 12–13 can't be checked here.Round 2 on
4b563c4:Checklist
AI Disclosure
gpt-6.2-sol, Claudeclaude-opus-5-5and Antigravitygemini-4-neonplan and visual reviews, Claude Code review subagentsclaude-opus-5-5🤖 Generated with Claude Code