Repository navigation
tools: keep the AV1, G15 and TypeC host tests building with their extracted sources - #294
Conversation
The suite rebuilds avd_av1_set_prob() and its neighbours from avd-av1.c by name and compiles them with -Werror. A driver whose avd_av1_set_prob() calls a static u64 avd_av1_ref_ts() helper (#260) no longer builds there: the helper is not extracted, the extractor only accepts int and void functions, and u64, s8 and U64_MAX are not defined. The control run then exits 1 before printing anything. Extract avd_av1_ref_ts() ahead of avd_av1_set_prob() when the driver defines it, accept u64 in the extractor and define the three types. A driver without the helper builds exactly as before. The two --mutation suites are registered as expected to fail, and any non-zero exit counted as a caught mutant, including a control program that did not build. In --mutation mode a build failure now reports that no mutant verdict was reached and exits 0, so CI flags the suite instead of passing it. Other harness failures are not changed. Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndex With avd_av1_ref_ts() in the driver, check what avd_av1_set_prob() does when the primary reference slot holds an invalid index: -1, as userspace passes for intra frames, -128, 8 and 127. It must look up no reference slot (timestamp U64_MAX, which matches no capture buffer) and inherit from the destination's own CDF area, the fallback avd_get_ref_buf() takes for an unknown timestamp. avd_av1_set_prob() writes the probabilities back to the destination's CDF area, so the destination after the call cannot show where they were read from. The case fills the destination with a non-periodic pattern, takes the expected CDF bytes from that pattern before the call, compares the probabilities with them, and checks afterwards that every destination byte still matches the pattern. --mutation fallback-offset moves only the fallback read (reference == destination) by one byte; the case catches it. The reference lookup fixture now records the timestamp and falls back to the destination for an unknown one; the existing inheritance cases still require the lookup to ask for timestamp 1000. The new cases and the new mutation apply only when the driver defines the helper; without it the suite runs the same 1792 controls as before, and the new mutation reports that no mutant verdict was reached. Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The suite builds admit() from g15/boot.rs against host models. With the T6031 system-sleep hold (#288), admit() reads the ASC control word before it takes the hold, passes whether to hold through system sleep to glue::hold_power(dev, sleep_hold), reads params::sleep_hold() and warns with dev_warn! when g15_sleep_hold=0 on T6031. The model has no dev_warn!, no params module and a one-argument hold_power(), so the admit() control no longer builds. Add dev_warn! (counted), params::sleep_hold() and a failing ASC read to the model, and pick the hold_power() mock from the admit() it is given: with the sleep-hold argument it records the value passed; without it, the model is the old one. Every existing scenario and mutant runs unchanged on both. For an admit() with the sleep-hold argument, also check that the hold is taken through system sleep only on T6031 with g15_sleep_hold on, that g15_sleep_hold=0 on T6031 warns once, that T6030 never holds through sleep, and that a failing ASC read returns before any hold is taken on either SoC. Four mutants (the hold on any platform, ignoring the parameter, no warning, the ASC read after the hold) each fail one of those checks. Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a tree where an occupied display pipeline is reported as -ENOSPC on every SoC, cd321x_display_taken() takes only the return code, and -EBUSY means a transient mux or PHY failure. The probe controls still call the two-argument form and no longer build there, and the disconnect scenario injects -EBUSY as an occupied display, which such a tree retries instead. When the tree has the one-argument helper, check its contract in the probe controls (-ENOSPC is taken; -EBUSY, -EAGAIN, -ETIMEDOUT, -EIO and 0 are not). In the disconnect scenario, let the mode stub classify its error through the real helper, inject -ENOSPC as the occupied display, and add a transient -EBUSY case that must retry before the USB role is switched. A tree with the two-argument helper runs the old checks unchanged. The probe control also zero-initializes its cd321x_pm_state: cd321x_pm_init() does not set setup_pending, which cd321x_pm_ready() reads. Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Generated-by: LLM
scottjones
left a comment
There was a problem hiding this comment.
We went through the four commits and ran the three suites on pancake (aarch64, gcc 16, rustc 1.93.1) against current integration/aurora 31748f0, with and without this PR and each target PR merged in. All merges are clean, including all four together.
Nothing here loosens a guard. No pins, hashes or host-tests.json entries change, and on the current tree the generated tests are the same as before: the disconnect unit is byte-identical, the probe unit differs only by budget={0} (pm.py:550), which matches production since cd321x comes from devm_kzalloc() in i2c.c/spmi.c. Each new branch is keyed on the new source shape (avd-av1-tail-tests.py:189, g15-display-order-tests.py:397, pm.py:617, lifecycle.py:464), and if that shape drifts, the build fails loudly instead of silently falling back to the old checks. The one removed assert, timestamp==1000 in the AV1 avd_get_ref_buf() mock (avd-av1-tail-tests.py:82), is replaced by an equivalent last_timestamp==1000 check in the only case that does a lookup.
The --mutation change at avd-av1-tail-tests.py:220 tightens things. On #260 without this PR, both registered mutants "pass" in CI only because the controls don't build (exit 1 counts as caught for an expect: fail entry). We reproduced that locally.
Results:
| tree | AV1 control / round-up / cpu-unaligned / fallback-offset | G15 | TypeC probe / disconnect |
|---|---|---|---|
| base | 1792 pass / caught / caught / n.a. | pass, 2 admit() mutants | pass / pass |
| base+#294 | 1792 pass / caught / caught / exit 0, no verdict | pass, 2 mutants | pass / pass |
| #260 alone | build fails (avd_av1_ref_ts implicit) / exit 1 / exit 1 |
||
| #294+#260 | 1796 pass / caught / caught / caught | ||
| #288 alone | admit() does not build (dev_warn, params, 2-arg hold_power) |
||
| #294+#288 | pass, 6 admit() mutants caught | ||
| #163 alone | probe fails to build (2 args) / pass | ||
| #294+#163 | pass / pass | ||
| all four | 1796 pass, 3 mutants caught | pass, 6 mutants | pass / pass |
Our own mutants beyond the PR's:
- AV1 on #294+#260: dropping
idx < 0, droppingidx >= V4L2_AV1_TOTAL_REFS_PER_FRAME, or returning 0 instead ofU64_MAXinavd_av1_ref_ts()all failinvalid_primary_index.s8→u8passes, but that one is equivalent. - G15 on #294+#288: an inverted
t6031test, the ASC read moved after the hold, and a warning when the hold is on all fail the control. - TypeC on #294+#163:
cd321x_display_taken()as-EBUSY,false,-ENOSPC || -EBUSYandret != 0fail both probe and disconnect (the new transient case at lifecycle.py:473).-ENOSPC || -EAGAINis caught by probe only. Without this PR, disconnect passes all of them, because its shim never called the real helper.
On the targets:
- #260 and #288: their only CI failure is the host test fixed here.
- #163: its host-test failure is
typec-probe, fixed here. Itscompilejob failed separately because it couldn't fetchrefs/pull/163/merge(exit 128), so KUnit was skipped and its changedcd321x_display_taken_testhasn't run in CI. Being 3152 behind didn't cause a conflict (it merges cleanly), but it will need a rerun or rebase after this lands.
Two small notes, neither blocking:
fallback-offsetisn't registered inhost-tests.json. It can't be until #260 lands, because it exits 0 before that. It would be worth adding withexpect: failin #260 or right after.- With #163, the model encodes
-EBUSYas transient on every SoC. That follows #163's change, so whether older SoCs still need-EBUSYas "taken" is a question for #163, not this PR.
Test-only, CI is green, and nothing changes for the current tree, so it fits the RC. Landing it first unblocks #260 and #288 on a rerun.
|
Physical boot smoke completed for the kernel from merge ref
All six passed boot-health and the focused smoke script and returned to their installed kernels. OMT failures/skips remain as reported; some references used older OMT versions. This exercises integration kernel code, not the four host-test files changed by this PR. The installed device trees were preserved. This is not HDMI/DSC, HEVC, suspend, new-DT or full hardware qualification. One recovery failure is retained: J516S's first return to installed Protected boot files, installed packages/configuration and audio were checked after return; leases are released. Restoration limits remain explicit: the first four ESP aggregate hashes included a per-boot random seed, so complete ESP byte equality is not established there; J293 lost two pre-existing unowned test-module trees with unproven attribution. Empty labd menu markers and J416C's saved-versus-live command-line difference are recorded. These are bounded smoke results, not a claim of identical whole-machine inventories or a clean first return on every machine. Normal current-base merge-queue checks still apply. |
These host tests compile production code extracted from the driver sources against host models. Three pending driver changes alter that extracted code, so the tests no longer build or hold for them.
This PR changes only the four host-test files below; no driver code. Each test keeps its existing checks for the current sources and adds the new checks only when the extracted source has the new shape.
AV1 tail controls:
tools/asahi/avd-av1-tail-tests.py(for #260)avd_av1_set_prob()callsavd_av1_ref_ts(), the tool extracts thatu64helper together with its types. Without the helper it builds as before.--mutationmode, a control program that does not build now reports no mutant verdict and exits 0. The runner's expected-failure check then rejects it instead of counting a caught mutant. Other harness errors are not reclassified.ref_frame_idx[0]cases (-1, -128, 8, 127), withprimary_ref_frame = 0, check:U64_MAXlookup;fallback-offsetmutation moves that read by one byte, and the new cases catch it. It is not registered inhost-tests.json.G15 admission model:
tools/asahi/g15-display-order-tests.py(for #288)dev_warn!,params::sleep_hold()and a failing ASC read. The one- or two-argumenthold_power()mock is chosen from the extractedadmit(). Existing scenarios and mutants are unchanged.g15_sleep_holdon;TypeC selftests:
tools/testing/selftests/drivers/gpu/apple-dcp/pm.pyandlifecycle.py(for #163)When
cd321x_display_taken()takes only the return code (-ENOSPC: occupied pipeline;-EBUSY: transient):-ENOSPCas the occupied display;-EBUSYcase must retry before the USB role is switched.The two-argument form keeps its old checks. The probe control also zero-initializes its
cd321x_pm_state:cd321x_pm_init()leavessetup_pendingunset, andcd321x_pm_ready()reads it.Validation (host only)
fallback-offsetmutants caughtadmit()mutants)admit()mutants caughtEach test was built with its own flags (
-Werror, and ASan/UBSan where the test uses them). These are host models of extracted code. They say nothing about firmware, hardware, suspend or runtime behaviour.The recorded CI failures of #260, #288 and #163 stand until each runs on a tree that contains this PR. Normal CI, code-owner review and the merge queue apply.
🤖 Generated with Claude Code