Repository navigation
Conversation
…rrectly at the end of the job if users call sc.stop manually
|
Can one of the admins verify this patch? |
Contributor
|
Please add the jira number to the pull request description. like: [SPARK-2506] In yarn-client mode,... |
Contributor
Author
|
@tgravescs ok, and any suggestions? |
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Nov 9, 2026
…un (apache#1429) ### What changes were proposed in this pull request? Four catalyst JIT suites start child JVMs ("probes") and read what HotSpot prints in them: `VarkaHugeMethodSuite` (which methods C2 compiles), `VarkaSplitInliningSuite` (what C2 inlines), `VarkaAssemblySuite` (the disassembly) and `VarkaWidthAuditSuite` (which Vector API calls C2 refuses at each width). Each had its own launcher. This PR replaces the four with one Java test helper, `VarkaChildProcess`, and gives every child a time limit that works while the child runs. How the helper works: - **`javaCommand(flags, mainClass, arguments)`** builds the child's command line: this JVM's `java`, `--add-modules jdk.incubator.vector`, `--enable-native-access=ALL-UNNAMED`, the suite's flags, the test classpath (`SPARK_DIST_CLASSPATH` when set, else `java.class.path`, as all four suites did), then the main class and its arguments. The suites pass the same flags they passed before. - **`run(what, builder, budgetSeconds, onLine)`** starts the child with its errors merged into its output. A reader thread hands each output line to `onLine`, where the suite's own parsing stays unchanged, and keeps the last 40 lines. The test thread meanwhile blocks in `Process.waitFor(budget, SECONDS)`. When that returns, the helper joins the reader thread, so everything `onLine` wrote is visible to the test thread. - **Three ways a run ends early, each one destroying the child** (and any processes it started): - The budget runs out: the failure is "`<what>` (pid N) did not finish within B s and was destroyed; its last lines: ...". - The test thread is interrupted, which is what `VarkaTestWatchdog` does at its cap: the helper waits up to 10 s for the destroyed child to be gone, and the failure is "`<what>` (pid N) was interrupted after T s, the test's watchdog the likely cause, and was destroyed; its last lines: ...". The interrupt is not set again. The watchdog has already failed the test, and a flag left on ScalaTest's runner thread would make every later probe's `waitFor` throw at once. - `onLine` throws, which is how `VarkaAssemblySuite` stops a child that prints more than 8 MB: the reader thread destroys the child itself (nothing would drain its pipe otherwise) and its exception reaches the test unchanged. - **`Run.requireSuccess(done)`** fails a child that exited non-zero, or exited 0 without printing the end mark the suite looks for, again naming it with its PID and quoting its last lines. - **`what` names the child**: the suite, the probe and its case, flags or width. Examples: "VarkaHugeMethodSuite's probe of a 16-output ladder at a method byte budget of 8000", "VarkaAssemblySuite's probe for case 'gatherLookup' under -XX:MaxVectorSize=16", "the audit probe asked for -XX:MaxVectorSize=16 (128 bits) (VarkaWidthAuditSuite)". - **`budgetSeconds(capMinutes, childrenPerTest)`** gives each child its test's watchdog cap less a 60 s margin, divided by the most children one test starts, so a test's children at their budgets always end before the watchdog does. The budget arithmetic per suite, at `VarkaTestWatchdog`'s default cap of ten minutes: | suite | children per test | budget per child | most a test waits on children | |---|---|---|---| | `VarkaHugeMethodSuite` | 1 | 540 s (was 300 s, never enforced) | 540 s | | `VarkaSplitInliningSuite` | 1 | 540 s (was 300 s, never enforced) | 540 s | | `VarkaAssemblySuite` | up to 4 | 135 s (was 300 s, never enforced) | 540 s | | `VarkaWidthAuditSuite` | 0 (five probes run in `beforeAll`) | 600 s, unchanged | none | `VarkaAssemblySuite`'s four: "every shape is still packed at 128-bit lanes" starts three probes, plus the lazy narrow-species probe when it is the first test to read that value. "The allocation pair holds at 128-bit lanes" starts at most three. The budgets follow `watchdogMinutes`, so a suite run with a longer cap (`-Dvarka.test.watchdog.minutes`) gets longer budgets. `VarkaWidthAuditSuite` loses row 581's private launcher (`runChild`, `ChildRun`, `failIfTimedOut`, the `runningChild` field and the `afterAll` that destroyed it) and the test of that launcher, which moves to the new suite. The helper's `finally` destroys the child whenever `run` exits, an interrupt included, so no child is left for an `afterAll` to find. A new JUnit 5 suite, `VarkaChildProcessSuite`, tests the helper with plain programs standing in for a probe: - `/bin/sleep 30` with a 1 s budget is destroyed within seconds, and the failure names it. - `/bin/sleep 30` whose waiting thread is interrupted after 0.5 s is destroyed, and the interrupt is not left set. - `/usr/bin/yes`, whose `onLine` throws at line 1000, is ended, and that exception reaches the caller. - A child that exits 3 fails with its exit and last lines, and one that exits 0 without its end mark fails saying so. - The budget arithmetic above. The PID quoted in each message is checked to be gone. `dev/varka_matrix.sh` leaves this suite out of the option matrix, as it does the other harness suites (`VarkaMatrixSuite`, `VarkaSuiteHarnessSuite`): no configuration can change what it tests. A new section of `sql/varka/skills/testing-and-debugging.md` (with its `SKILLS.md` contents entry) tells the next probe suite to start its child through the helper, and why. ### Why are the changes needed? All four launchers had the defect row 581 found in `VarkaWidthAuditSuite`. Each read the child's output to its end on the test thread and only then called `Process.waitFor(300 s)`. The output ends only when the child exits, so the wait never timed out. A child that ran long was cut off only by `VarkaTestWatchdog`'s ten-minute cap on the test. The watchdog interrupts the test thread, but an interrupt does not end a read blocked on a pipe. If the child exited within the watchdog's 30 s grace, the next `waitFor` threw a bare `InterruptedException` that named no child. If it did not, the watchdog halted the JVM and the shard aborted. Nothing destroyed the child either way. The message a working timeout would have given, "the probe did not finish within 300 s", named no probe in two of the suites. On paper `VarkaAssemblySuite` could also exceed the cap without any hang: three probes in one test, at 300 s each, add up to 900 s. ### Does this PR introduce _any_ user-facing change? No. Test code only. ### How was this patch tested? On the laptop, with `VARKA_HSDIS_DIR` set and `VARKA_HSDIS_REQUIRED=true`, so the assembly suite could not skip: build/sbt 'catalyst/testOnly *VarkaChildProcessSuite *VarkaHugeMethodSuite *VarkaSplitInliningSuite *VarkaAssemblySuite *VarkaWidthAuditSuite *VarkaEmittedBytesSuite *VarkaCoverageSuite *VarkaMatrixSuite' Total 58: 58 passed, 0 failed, 3 cancelled (the opt-in audits of `VarkaEmittedBytesSuite` and `VarkaCoverageSuite`, which cancel unless asked for). Per suite: `VarkaChildProcessSuite` 5 of 5, `VarkaHugeMethodSuite` 2 of 2 (6 s each), `VarkaSplitInliningSuite` 2 of 2 (3 s and 5 s), `VarkaAssemblySuite` 13 of 13 (0.3 to 5.3 s per test, so each probe took well under the 135 s budget), `VarkaWidthAuditSuite` 6 of 6 (its five probes took 85 to 105 s each in `beforeAll`, every test body milliseconds), `VarkaMatrixSuite` 11 of 11, run since the matrix script changed. To check the failure path on real probes, `VarkaHugeMethodSuite` was run with `-Dvarka.test.watchdog.minutes=1`, which makes the budget 1 s. It failed with "VarkaHugeMethodSuite's probe of a 16-output ladder at a method byte budget of 8000 (pid 1478550) did not finish within 1 s and was destroyed", and no probe process was left running. Also run: `dev/varka_precommit.sh`, catalyst `Test/scalastyle`, `dev/lint-java` (checkstyle over the new Java), `python3 dev/varka_plan_lint.py --check --offline` and `python3 dev/varka_quote_check.py`; `dev/varka_errorprone.sh` passes but reads only main sources, so it does not cover this test code. No generated file is affected: the probes' command lines and their parsing are unchanged. ### Accepted trade-offs - **`VarkaHugeMethodSuite` and `VarkaSplitInliningSuite` now allow a child 540 s rather than 300 s**, since the budget is derived from the cap rather than chosen per suite. Their probes take 3 to 6 s here, and about 54 s on a runner (`sql/varka/ci/suite-times.tsv`). - **`VarkaAssemblySuite` gives every child 135 s, including in its one-probe tests**, from a counted four children per test rather than a per-test deadline. Its probes take 0.3 to 5 s here; at the nine times slower that `VarkaHugeMethodSuite`'s probes run on a runner (about 54 s against 6 s), that is about 45 s, a third of the budget. - **An interrupt during `VarkaWidthAuditSuite`'s `beforeAll` now fails that probe, and the probes after it still run**, where a bare `InterruptedException` used to abort the suite; no watchdog guards `beforeAll`, so nothing in the build sends that interrupt. - **A cap of a minute or less leaves each child a 1 s budget.** The 60 s margin is fixed rather than scaled to the cap. A cap of 0 has no "no limit" meaning, which `VarkaChildJvm` gives it, since no ScalaTest suite uses one. - **`VarkaChildJvm` keeps its own launcher.** It runs a whole suite in a child JVM and reads a JUnit report back, which is a different job from a probe. - **After a normal exit the helper joins the reader thread without a bound**, which holds only while no probe starts a process that inherits its output; none does. - **Other launchers keep the same read-then-wait shape**: `VarkaOperatorCensusSuite`, `VarkaInliningCliffSuite`, `VarkaKernelWarmupSuite`, `VarkaSanitizedWarmupSuite` in catalyst and `VarkaSizeLadderJitSuite` in sql/core. They are outside this row's four suites. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-5-5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Nov 9, 2026
…budget (apache#1431) ### What changes were proposed in this pull request? Adds row 585 to milestone 8's plan: move the child JVMs of five more test suites onto the shared, time-limited launcher that apache#1429 adds (`VarkaChildProcess`). `VarkaOperatorCensusSuite`, `VarkaInliningCliffSuite`, `VarkaKernelWarmupSuite` and `VarkaSanitizedWarmupSuite` in catalyst, and `VarkaSizeLadderJitSuite` in sql/core, each read a probe JVM's output to its end on the test thread and only then call `waitFor` with a timeout. The output ends only when the child exits, so the timeout can never fire while the child runs. A hung probe holds the test until the test watchdog interrupts it; the interrupt does not end the blocked read, the child is not destroyed, and the failure names no probe. This is the defect that apache#1416 and apache#1429 fix in four other suites. ### Why are the changes needed? A probe that hangs on a slow CI runner turns into a Build that hangs until the job's time limit, with a message that names no cause; apache#1413's Build was lost that way today in `VarkaWidthAuditSuite`. Recording the five remaining suites as a row keeps the fix from being forgotten once apache#1429 lands. ### Does this PR introduce _any_ user-facing change? No. It changes only the milestone plan. ### How was this patch tested? `dev/varka_plan_lint.py --check --offline` reports no findings. The five call sites the row cites were read at the current master. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-5-5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Nov 11, 2026
…e#1509) ### What changes were proposed in this pull request? This is a plan-only change to milestone 8's task table (`sql/varka/plans/m8/PLAN.md` section 3). I read every row whose state is not `Done` against the pull requests merged under its id and against its done-when. Eleven rows are closed, one is marked done in part, and two rows that lag merged work have their state text corrected. Only the state clause of each row changes. Merge dates are in CET. | row | old state -> new state | evidence | | ---: | :--- | :--- | | 554 | Started -> Done | apache#1312 merged 3 November. Its own Build was cancelled. The size step later failed the lint job of apache#1427's Build (run 42606922446) with "1357 counted lines ... at or over the cap of 1000" and the largest files. Passing changes print their count. That 1357 is the over-count row 588 later fixed, but it still shows the failure path. | | 558 | Started -> Done | apache#1320 merged 3 November. `varka_lint.py --selftest` passes in the Varka docs checks job, `ci-gates` included. The Build of the plan-only apache#1506 (run 43087405861) skipped both the protobuf job and the UI job. | | 559 | Started -> Done | apache#1329 merged 4 November. Every chain explains in under 2 ms at depth 20, with verdicts and bytes unchanged (`VARKA-559.md` 6, `results/VARKA-559-planning-cost.txt`). | | 569 | Started -> Done | apache#1367 merged 5 November. The hook refuses the wrong checkout and names the fix. `dev/varka_prepush.sh --selftest` is in the lint job and passes. | | 580 | Started -> Done | apache#1426 merged 9 November. The row was done when it merged. The grammar draws a narrow `BitCount` again (`VarkaIrGrammar` case 10). | | 581 | Started -> Done | apache#1416 merged 9 November. The first three Builds whose heads hold it passed catalyst shard 1 of 3: runs 42589018437, 42602246363 and 42602326887. No later run of that job failed through 03:00 UTC on 10 November. In their JUnit reports `VarkaWidthAuditSuite` spends 538 to 1099 s in `beforeAll`, and its longest test takes 1.0 s. | | 582 | Started -> Done | apache#1429 merged 9 November. The row's only open item was review and merge. `VarkaChildProcess` and `VarkaChildProcessSuite` are on master. | | 585 | Started -> Done | apache#1441 merged 10 November. The Build of its head `f017ecac0e8` (run 42699618930) passed all seven suites, according to its JUnit reports. The census suite's one skipped test is the host-census file check, not a child-JVM test. | | 588 | Started -> Done | apache#1471 merged 11 November. The lint job's other steps continue on error. apache#1427's merge commit is in master's history, so the self-test's pinned case counts 52 lines both in the docs-checks job's full clone and on the laptop. | | 589 | Started -> Done | apache#1465 merged 11 November. `notify_test_workflow.yml` is gone, and no `pull_request_target` sync has run since. apache#1506's `Build` check (check run 130755752876) was created while fork run 43087405861 was still running, and it completed with that run's success. | | 595 | Started -> Done | apache#1481 merged 11 November. `dev/varka_precommit.sh --selftest` passes. | | 594 | Started -> Done in part | apache#1463 merged 10 November. Its dry-run table passes every baseline but one at both widths, on AVX-512 and under `-XX:UseAVX=2` on the same laptop. Left: `VarkaBooleanOutputBenchmark`, which stops by design until row 27's step 6, and a dry run on a real AVX2 host. | | 340 | Started (text) | "built on branch" now reads "merged as apache#1397" for steps 2 to 4 and "merged as apache#1434" for step 5. The runner measurement is still owed. | | 414 | Started (text) | "built" now reads "built and merged as apache#1454". The fuse after the SPARK-61352 sync is still owed. | Rows left as they are: - 591: apache#1464 merged, and retry runs exist on vecbricks/varka, for example 43039739304. The post-merge check of `VARKA-591.md` 3 is not recorded on master, so this is unverified. - 572: this change does the reading that row 572 leaves open. The row can close once this change merges. - 414: its done-when is met by its "stays declined with the reason recorded" branch. The row still names the post-sync fuse as owed, so I left the state to the owner. - 27, 157, 332, 341 to 344, 347 to 349, 352, 359, 361, 363, 506 and 577: the type rows. Each one names steps or runner measurements that are still left, and merged work does not finish them. - 483, 490, 491, 493, 507, 508, 510, 512 to 517, 519 to 521, 523 to 530, 532, 533, 536, 538, 546, 555, 557, 563, 565 and 573: the harness rows. Each one's open item is a CI measurement, a matrix run or an owner decision, and master records none of them. For 565, the EPYC regeneration is still owed. For 573, a scheduled run (42355859989) is cited in row 330, but the row's own list of open items is longer. - Planned rows with only plan PRs merged, and every row with an open PR today (103, 104, 339, 342, 345, 360, 541, 578, 584, 592, 593, 596 to 598, 603, 606), were not changed. ### Why are the changes needed? The owner asked on 11 November 2026 for the rows whose work had finished to stop reading as Started. A count of the milestone reads these states. ### Does this PR introduce _any_ user-facing change? No. Only the plan changes. ### How was this patch tested? - `python3 dev/varka_plan_lint.py --check`, online so that the run-head pairing of row 585 is checked: 0 findings. - `python3 dev/varka_push_check.py`: passed (28 counted lines). - `varka_msg_check.py`, `varka_precommit.sh`, `varka_prepush.sh` and `varka_lint.py` self-tests: ok. - One `/code-review high` pass: found 10 / fixed 5 / left 5. Fixed: - row 588 wrongly said CI runs the apache#1427 case vacuously; - rows 558, 569 and 588 named the lint job for self-tests that run in the Varka docs checks job; - row 594 contradicted itself and did not say its AVX2 columns are emulated; - row 554 claimed "every Build since" without a source; - row 589 still named its branch. Left: - `VARKA-559.md` 9 still says "not opened". This change rewrites only the plan's state clauses. - Row 414 meets its done-when through the "stays declined" branch, but the row keeps the post-sync fuse as owed. That is the owner's call. - `varka_plan_lint.py` reads run heads from vecbricks/varka, so a fork Build citation such as row 585's can never be checked. That is a tool change, not a row change. - Row 585's skipped census test is the host-file check (see the table). - Row 595's "differs from both parents" rule is the reading of "what it adds over its first parent" that leaves out what master brings, which is the row's intent. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...ctly at the end of the job if users call sc.stop manually. There are two minor bugs: