AndroidDeviceCodecs' enumeration rules have no test, and its failure fallback contradicts its own log line #194
Closed
opened 2026-09-02 12:46:11 +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
No labels
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#194
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.
Wave 4, filed from a coverage read on
main@54ca2dd, 2026-09-02: 92.8% line (2183/2352), 81.3% branch (1091/1342), 584 JVM tests in 87 classes. This ticket carries the wave's shared filter note, at the bottom.This is not a reopen of #86 or #133 — read that first
AndroidDeviceCodecs.probe()(app/src/main/java/org/libremediaconverter/codec/AndroidDeviceCodecs.kt:49-76) is 20 never-executed lines, the biggest single block on the report. It has been considered twice and left out twice, and both closes were right about what they were closing:probe()queries the realMediaCodecList… that is the class's whole purpose and it cannot be answered on the JVM."ShadowMediaCodecListin hand and still declined, for a reason worth quoting:MediaCodecInfoBuilder"has nosetIsAliasand nosetCanonicalName, so the alias skip (:58) and the canonical-name dedup (:59) — the two things the class's KDoc calls out as easy to get wrong — are not reachable through it. What is reachable is theisHardwareAccelerated && !isSoftwareOnlyfilter and the video/non-video split, which is enumeration bookkeeping."That objection is specific to the shadow. A pure seam does not have it, and #133 did not consider one — it evaluated the shadow route and closed it. This ticket is the other mechanism, and it makes reachable exactly the half #133 named as unreachable.
If you are reading this and about to re-argue
ShadowMediaCodecList: don't. That spike has been run twice and #133 exists to stop a third.The seam
The thin edge keeps only the mapping from
MediaCodecList(REGULAR_CODECS).codecInfosontoCodecEntry. Everything else — the alias skip, the canonical-name dedup, thevideo/prefix filter, the encoder/decoder split, theisHardwareAccelerated && !isSoftwareOnlypredicate, and therunCatching— moves inside.The supplier shape is load-bearing, not a preference
A seam taking
List<CodecEntry>cannot provoke the failure path at all: therunCatchingwould stay in the edge, andcapabilitiesFrom(emptyList())would pin empty → restrictive, not failure → restrictive. A test KDoc claiming the latter would be a passing test with a wrong explanation — precisely what wave 3 caught onprobeForConcat, where the KDoc claimed to drive acatcharm that turned out to be unreachable.If the supplier shape proves awkward in practice, say so in the PR and narrow the claim: the test pins empty → restrictive, and the failure → empty line stays uncovered in the edge. Do not write the broader KDoc over the narrower test.
The code change that goes with it: the fallback says the opposite of what it does
:72:With empty sets,
canEncode(H264)resolvesmimeFortovideo/avc, asks"video/avc" in emptySet()and answers false;canDecode("h264")likewise. So an enumeration failure routes everything to FFmpeg. That is the restrictive fallback, not the permissive one the log line and the class KDoc at:20-23both imply.Decided: the code is right and the message is wrong. All-FFmpeg on an unreadable codec list is the safe answer — FFmpeg can do everything Media3 can, only slower. Keep
AndroidDeviceCodecs(emptySet(), emptySet()); rewrite the log line to say it routes everything to FFmpeg, and correct the class KDoc to match. The test then pins that as deliberate rather than accidental.Behaviour the tests assert
isAliasis skipped, and a second entry sharing acanonicalNameis counted once — the two things the KDoc calls out and the two the shadow cannot reach.video/*encoder reacheshardwareEncodersonly when hardware-accelerated and not software-only.audio/*types are ignored entirely on both sides.canEncode(H264)isfalse, so the router sends the job to FFmpeg.Acceptance: the mutation that must go red
Drop
!info.isSoftwareOnlyfrom the encoder predicate at:64. Restore, confirm green.Not the acceptance
The coverage number, for the reason
CLAUDE.mdand #84, #86 and #88 each give. The argument for cutting this seam is that it turns a device-bound behaviour into a decision a test can choose the inputs for — which is the barCLAUDE.mdsets — and that the failure fallback's behaviour contradicts its own comment today. A seam cut only to make a percentage move is worse than the uncovered line it replaces.The wave's filter note
Wave 3 filtered candidates to
mi > 0. That filter fails in both directions:JoinScreen.kt:222showsmi=10— and alsoci=38, andJoinStateAffordancesTestalready clicks that Save button and assertssave:joined.mp4. The missed instructions are the synthesized$changed/$dirtyrecomposition-skip path — the same codegenCLAUDE.mdalready warns about for branch counts on these files, showing up in the instruction count too. EveryonClicklambda body on the flagged screen lines is covered at method level.ConversionViewModel.cancel()runs in the suite, so no line of it is missed — yetactiveWorkId?.let(workManager::cancelWorkById)has only ever been entered on the null side. That is #192, the largest real gap in this wave, and no line-level filter finds it.Use two filters together:
ci == 0— the line never executed. This is JaCoCo's own missed-line definition, so it totals exactly the reported 169.ci > 0 && mb > 0at method level — a covered method with an arm nothing takes.Of the 251 missed branches, only 18 sit on lines that do execute, so the branch gap and the line gap are largely the same gap; filter 2 is about which of them are reachable.
This pass was coverage-driven. Assertion gaps — wave 3's more productive find — were not hunted systematically. #200 fell out anyway; do not read this wave as "everything that is untested".