Repository navigation
Description
Problem
In one Tier 2 container (the local gate's tier2-linux lane, or run.py on a developer host), ctest runs the five test_deinterlace_2x_field_order_<rate> tests with RUN_SERIAL. Each test runs alone, and all other ctest jobs are idle while it runs. The tests are real-time tests: under concurrent load, CI dropped fields (#1343, #1643), so the isolation is necessary.
On a large host, this barrier is most of the Tier 2 time. Measured on a 24-core host with OBS_CTEST_JOBS=16 (one mode):
| Part | Time |
|---|---|
| The five deinterlace tests, one after the other, alone | 147 s |
The other 587 tests (longest: test_slideshow_mem_cap, 95 s) |
about 95 s |
| ctest, total | 242 s |
For the two modes, this is 294 s of the 568 s of tier2-linux. CI does not have this problem: it runs the serial part on separate runners (#2071, #2072).
Measurement: own cores instead of RUN_SERIAL
The isolation that #1643 needs is CPU time, not an empty machine. I ran the serial part concurrently with the suite part, on separate CPUs (taskset), in the validate container with an existing build tree:
- Suite part:
ctest -j14 -E '^test_deinterlace_2x_field_order_'on CPUs 10-23. - Serial part, at the same time: the five rates concurrently, each in its own process with
LP_NUM_THREADS=1and its ownxvfb-run, each on two CPUs (0-1, 2-3, ..., 8-9). - 10 iterations.
Results:
- Deinterlace: 0 failures in 50 rate runs. The time of each rate (27.7 s to 33.3 s) is the same as when the rate runs alone.
- The serial part takes about 31 s, against 147 s. One iteration (both parts) takes about 94 s, against 242 s for one mode today. The suite part is now the longest part.
- Host temperature and an NDI/OBS workload on the same Proxmox host were not affected (0 skipped frames).
Note: my harness did not mount the checkout at /ro, so 33 suite tests that need source data failed in every iteration. They also fail alone in that harness, so this is not an effect of the load. A run through validate.sh will not have this problem.
Proposal
An opt-in in rust/tools/linux-validate/validate.sh, for example OBS_TIER2_SERIAL_CPUS=<cpu list>:
- When the variable is set and
OBS_CTEST_PARTandOBS_CTEST_SHARDare not set, each mode runs its two parts at the same time: the serial part on the given CPUs, the suite part on the remaining CPUs.select_partalready gives the two test lists. - When the variable is not set, nothing changes. CI does not set it, so CI and the serial runners of perf(ci): cut the Tier 2 critical path of merge-queue runs (11 min, measured 2026-10-24) #2072 do not change.
run.pypasses the variable into the container. The local gate can then set it on a large host.
Points to decide:
- Pin each serial test to its own CPUs (as in the measurement), or run
ctest -R <serial> -j5on the whole serial CPU set. The first is what I measured. - The two ctest processes share the build tree.
Testing/Temporary/CTestCostData.txtandLastTest.logmust not be written by both. A possible solution: run one part with its own--test-dir-independent log and cost file, or merge the two cost files after the run. - Each part needs its own
xvfb-run -adisplay. - A failure in one part must fail the mode, and both logs must stay complete.
Possible second step
In each case, about 550 ms are fixed sleeps: 300 ms after the frames are played and 250 ms to drain the output (check_field_order()). The burst cases already wait for rendered frames with wait_ticks() instead of a fixed time. The same change for the other cases would make each case about 25 % shorter, also on the CI serial runners. It needs its own repeated runs, because an incomplete drain can affect the next case. This is a separate change.
Related
- local gate: run tier2-linux beside the Rust lanes, and make the nextest thread count configurable #2769 / infra(gate): run tier2-linux beside the host lanes and lift nextest's bound (#2769) #2771:
tier2-linuxin its own heavy group. With both changes, the local gate is about 5 minutes on this host (17 minutes before).
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 28, 2026
Claiming: investigation
Investigating the measurement in the report and shaping it into one opt-in PR (default behaviour unchanged).
Plan:
OBS_CTEST_PART,serial-tests.py) and that the serial part cannot be parallelised through ctest: each of the five tests carries theRUN_SERIALproperty, which keeps them one-at-a-time even under-j. So the implementation follows the measurement — the serial part runs each test as its own process, pinned, with its ownxvfb-run.ci/test_*.pythat fails on master — it assertsvalidate.shhonoursOBS_TIER2_SERIAL_CPUSand that a serial runner module exists and runs registry tests concurrently on separate CPUs.rust/tools/linux-validate/serial-runner.py(reads the CTest registry, filtersRUN_SERIAL, runs each command pinned to its own CPUs withLP_NUM_THREADS=1, prefixes and keeps each log, non-zero if any test fails), thevalidate.shbranch that runs the suite part and the serial part at the same time, and therun.pypassthrough so the container sees the variable.Decisions:
CTestCostData.txt/LastTest.loghave a single writer (the suite part). No merge step and no second--test-dir. The trade-off: the five serial tests lose their cost entries — they are pinned one per CPU pair anyway, so ctest's longest-first scheduling has nothing to order.xvfb-run -a(the measurement's shape), so the available display number stays the suite part's business.$build.ctest-<mode>.logfor the suite,$build.serial-<mode>.logfor the serial part).OBS_TIER2_SERIAL_CPUSchanges nothing; CI does not set it, so the serial runners of perf(ci): cut the Tier 2 critical path of merge-queue runs (11 min, measured 2026-10-24) #2072 are untouched.zackees commentedon Oct 28, 2026
/ready
Triage: the measurements and the proposal are complete and the shape is one opt-in PR (plan in the claim above). Scope:
OBS_TIER2_SERIAL_CPUSinvalidate.sh+run.pypassthrough + a serial runner module, offline tests, default unchanged. Opt-in, ~48% off one mode locally (242 s -> ~94 s measured).zackees commentedon Oct 28, 2026
Claiming: Tier 2 local: run the RUN_SERIAL part beside the suite on its own CPUs (
OBS_TIER2_SERIAL_CPUS)Proceeding with the plan and decisions in the claim above. One PR from
fix/2773-serial-cpus, RED first (offline tests), default unchanged.ci(tier2): run the RUN_SERIAL part beside the suite on its own CPUs (#…
zackees commentedon Oct 28, 2026
Progress: PR #2779 (draft) has the RED and the GREEN.
56a85edd8:ci/test_tier2_serial_cpus.py, seven of ten cases fail on master (noOBS_TIER2_SERIAL_CPUS, no serial runner).73c795cd1:rust/tools/linux-validate/serial-runner.py(run/suite-cpus/pin), thevalidate.shconcurrent branch (with a guard against combining it withOBS_CTEST_PART/OBS_CTEST_SHARD), therun.pypassthrough, a README section, andci/test_tier2_env.pyreading the newtest_env_pairsarray.Decisions as claimed: per-test CPU pairs as measured; the serial part has no ctest of its own (so
CTestCostData.txtkeeps a single writer, and the five pinned tests lose cost entries that had nothing to order a one-per-pair schedule); onexvfb-run -aper test; either part failing fails the mode with both logs kept; untouched when unset.Measured here (16 cores, serial 0-9, suite 10-15) in the Tier 2 image against this checkout's build tree:
tree.ctest-OFF.logwas still running the suite tests (10/585, each 17-19 s). The suite part on this 8-physical-core box is much slower than the reporter's 24-core measurement, so I stopped that run at 15 min instead of quoting a full-mode total.Local checks: the new and neighbouring
ci/test_*sets pass (66 + 53 tests),ruff checkclean. Waiting on PR CI.test(tier2): read the default invocation from the new branch (#2773)
zackees commentedon Oct 28, 2026
PR #2779 is ready and queued for the merge queue (CI green: Format, Fast Gate, Tier 2 Linux build + tests OFF/ON + both serial shards, CI Gate).
What landed vs the report:
OBS_TIER2_SERIAL_CPUS=<cpu list>is the opt-in invalidate.sh, passed through byrun.py; unset, the lane is unchanged and CI (which never sets it) keeps the perf(ci): cut the Tier 2 critical path of merge-queue runs (11 min, measured 2026-10-24) #2072 serial runners.LP_NUM_THREADS=1, ownxvfb-run -a, own log). It deliberately does not use ctest:RUN_SERIALkeeps those tests one-at-a-time even under-j, and a second concurrent ctest would race the suite part'sCTestCostData.txt. Consequence: the five pinned tests lose cost entries, which had nothing to order anyway.Still open, deliberately: the "possible second step" (replace the 550 ms fixed sleeps with
wait_ticks()) is a separate change with its own repeat-run evidence, as the report says.zackees commentedon Oct 28, 2026
Closing: implemented by #2779 (merged 11:51Z as a direct follow-up of this issue).
OBS_TIER2_SERIAL_CPUSinrust/tools/linux-validate/validate.shruns the RUN_SERIAL deinterlace part beside the suite part, each rate in its own process withLP_NUM_THREADS=1and its ownxvfb-runon its own CPU pair; unset, nothing changes, so CI is untouched.rust/tools/linux-validate/serial-runner.pyis the runner,run.pypasses the variable into the container, and the README documents the knob.ci/test_tier2_serial_cpus.py(10 cases) plus the tier2/run/env/fanout suites (66) and theci/proof suites (53) all green; ruff clean.Not changed, deliberately:
RUN_SERIALstays on the ctest side, so the default local gate and CI keep today's behaviour.ci(tier2): run the RUN_SERIAL part beside the suite on its own CPUs (o…