HardwareFallbackTest passes on every emulator leg without ever attempting the hardware path #223
Closed
opened 2026-09-06 02:52:56 +00:00 by JMR-dev
·
0 comments
No Branch/Tag Specified
main
fix/102-picker-back-press-overshoot
fix/268-saf-picker-determinism
feat/ogg-vorbis-libvorbis
feat/expedited-conversion-work
fix/gate-cache-in-worktrees
chore/gate-runs-shellcheck
test/publish-delete-arm-real-provider
docs/e8-instrumented-coverage
docs/api37-carrier-count-drift
docs/e7-second-constraint
test/publish-to-a-real-saf-destination
fix/api37-report-match-line
fix/api37-task-snapshot-crash
test/join-failure-message-on-device
docs/e2e-read-findings-e7
test/cancelling-a-running-export
test/reattach-to-a-running-job
test/content-uri-reaches-ffmpeg
fix/launcher-wiring-waits-for-the-pick
fix/cancel-tests-need-a-slower-encode
test/cancelling-a-running-join
test/cancelling-a-running-session
test/notification-cancel-action
test/ffmpeg-progress-is-observed
test/fallback-asserts-the-path
test/flac-and-opus-assert-their-format
docs/e2e-read-findings
docs/wave4-coverage-numbers
fix/injectable-startup-sweep-scope
test/session-outcome-seam
test/launcher-callback-identity
test/theme-follows-system-dark
test/audio-drop-arm
fix/rotation-waits-for-recreation
fix/convert-guards-on-ready
test/retry-save-mime
test/hardware-progress-reaches-workmanager
test/ffprobe-mapping-seam
test/device-codec-enumeration-seam
test/unknown-container-row
test/null-message-fallbacks
test/cancel-reaches-workmanager
docs/coverage-wave3-recovery
test/concat-engine-seam
docs/coverage-wave3
test/mediaprobe-merge-seam
test/adaptive-shell-wiring
test/aac-audio-args
test/notification-progress-text
test/media3-muxer-guard
test/hardware-fallback-and-cancellation
test/unprobeable-join-clip
test/one-branch-outcomes
test/foreground-type-regimes
fix/bound-wedge-diagnostics
docs/coverage-wave2
test/screen-wiring
test/viewmodel-setters
test/join-state-mapping
test/conversion-state-mapping
test/dedupe-user-messages
fix/restore-stack-merges
test/refused-jobs
test/concatworker-failure-arms
test/container-capabilities-audio
test/readspec-enum-fallbacks
test/outputpublisher-seams
test/mediaprobe-track-seam
test/outputpublisher-partial-branches
test/fake-provider-scaffolding
docs/coverage-read-findings
chore/gitignore-kotlin
test/bound-the-hangs
docs/coverage-remeasure
ci/baseline-counter-precision
fix/invalid-suggestion-chip
ci/wedged-leg-report
fix/reattachment-overwrites-pick
test/theme-live-branches
fix/failed-save-retry
fix/empty-composition-crash
ci/advisory-failure-report
docs/seven-run-counts
test/release-permission-guard
ci/build-workflow-permissions
docs/api37-point-release
docs/benchmark-populate-path
fix/dead-assertion-probe-test
ci/actionlint
test/device-codecs-encode-consequence
fix/sdkmanager-pipefail
docs/readme-restart-claim
fix/saf-picker-root-discovery
fix/probe-dispatcher-seam
test/media3engine-mime-tables
test/mediaprobe-pure-helpers
fix/codec-vocabulary-drift
docs/robolectric-rationale-correction
docs/api37-advisory-counts
test/r38-8-saf-e2e
test/r38-7-join-states
test/r38-6-conversion-states
test/r38-5-state-seam
fix/jacoco-robolectric-coverage
docs/instrumented-tests-correction
test/r38-2-filecard
test/r38-4-advanced-picker
test/r38-3-pickers
tools/file-issue-script
tools/api-37-emulator
fix/review-app-gaps
docs/review-corrections
No results found.
Labels
Clear labels
above-cut
accessibility
backlog
bug
confirmed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
plausible
question
sev:high
sev:low
sev:medium
wontfix
Worked autonomously overnight: local, JVM-verifiable, no product decision
Barrier affecting people with disabilities
Held for manual review: product/UX call, CI/workflow, hardware, or unverifiable here
Something isn't working
Reviewer demonstrated the defect
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Reviewer could not fully demonstrate it; treat as unproven
Further information is requested
High severity
Low severity
Medium severity
This will not be worked on
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JMR-dev/LibreMediaConverter#223
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Filed from the 2026-09-05 e2e read of the instrumented suite on
main@4b02294. The findings that a test would not fix areE1-E6indocs/e2e-read-findings.md.HardwareFallbackTest.aFileMedia3CannotDecodeStillConvertsViaFfmpegis the only automated test of the hardware→software fallback against a real codec failure. It passes on every CI leg without ever attempting the hardware path.Measured, not inferred
Run
34004304566(all legs green), from each leg's owne2e-diagnostics-api*logcat:Identical on API 33, 34, 35 and 37. API 36's logcat artifact on that run is truncated to 838 KB with no test output, so it is unread rather than different.
The test ran in 448 ms — a failed HEVC hardware export followed by a full software re-encode of a 3 s clip cannot happen in that time.
Why it passes anyway
Both are true of a conversion that went straight to FFmpeg.
ConversionRouter.kt:153-155routes to Media3 only whendevice.canEncode(H265); on an emulator that is false, sorunMedia3OrFallBack'scatch(ConversionWorker.kt:212-217) is never entered. The test has no hardware precondition and asserts nothing about the path.Deleting that
catchentirely reddens nothing, anywhere, on any leg. That is the mutation.The repository already knew this
ForcedFailureTest.hardwareFailureFallsBackToSoftware, in the same package, pins the device profile and says why:ConversionWorkerTest.routesAFastMp4JobByDeviceCapability:142-148records the same fact a third time.The asymmetry is why nobody noticed.
ForcedFailureTestassertshardware.called, so without its pin it would fail on emulators — loudly.HardwareFallbackTestasserts only that an output appeared, so it passes. Same hazard, opposite symptom.State the gap precisely
The fallback wiring is covered on every leg by
ForcedFailureTest, with fakes (ExplodingHardware+RecordingSoftware). This ticket is not "the fallback is untested".What has never run on any emulator is a fallback triggered by a real mid-export codec failure — the case this test exists for, and the only reason
sample_h264_444.mp4is committed. That fixture was generated with x264 specifically because Fedora's ffmpeg ships openh264 and cannot produce High 4:4:4 (HardwareFallbackTest.kt:38-43), and it does nothing on any CI leg today.Its own KDoc states the standard it fails:
It does not even skip.
What a fix has to decide
Not
assertEquals(MEDIA3, KEY_ENGINE_USED). After a fallback the engine used is FFmpeg — that is the point — and it is FFmpeg whether the fallback fired or the router went straight there. Asserting it changes nothing.The vacuity guard is two facts together: the router chose
MEDIA3for this request on this device, and the worker reportedFFMPEG. Together they say static routing wanted hardware and the runtime result was software, which is the fallback and nothing else.Reaching the first fact is the decision, and there is no third source of truth on a device —
MediaCodecListis whatAndroidDeviceCodecsreads, so any oracle built from it is the same oracle (E6):assumeTrue(AndroidDeviceCodecs.get().canEncode(H265))— a visible skip on emulators. The suite's "2 skipped" becomes 3, which is a numberdocs/local-emulator.md:305and every leg's report already track. Honest, and the test still runs on the Pixel.Both are defensible and the ticket deliberately does not choose — same shape as #178 and #204. Whichever wins, say so in the class KDoc, because the current one claims the opposite of what runs.
Done means
The mutation above (delete the
catch) goes red somewhere, or it is written down that it cannot on emulator hardware and the test announces that fact on every run. A green leg must stop being readable as evidence that the fallback works.Related
E6indocs/e2e-read-findings.md— why there is no independent oracleAndroidDeviceCodecs'runCatchingfallback returns empty sets, which would make this vacuous on the Pixel too