Repository navigation
[SPARK-2452] Create a new valid for each instead of using lineId. - #1441
ScrapCodes wants to merge 2 commits into
Conversation
…use Line ids can be same sometimes.
|
QA tests have started for PR 1441. This patch merges cleanly. |
|
QA tests have started for PR 1441. This patch merges cleanly. |
|
QA results for PR 1441: |
|
QA results for PR 1441: |
|
Okay merging this into master. For the 1.0 branch we just reverted the fix. |
Author: Prashant Sharma <prashant@apache.org> Closes apache#1441 from ScrapCodes/SPARK-2452/multi-statement and squashes the following commits: 26c5c72 [Prashant Sharma] Added a test case. 7e8d28d [Prashant Sharma] SPARK-2452, create a new valid for each instead of using lineId, because Line ids can be same sometimes.
…they run (apache#1441) ### What changes were proposed in this pull request? Five more JIT suites start child processes ("probes") and read what HotSpot prints in them: `VarkaOperatorCensusSuite` (whether C2 lowers each Vector API operator at each width), `VarkaInliningCliffSuite` (C1's call-site cliff, plus the Python reader of its log), `VarkaKernelWarmupSuite` and `VarkaSanitizedWarmupSuite` (the kernel warm-up's verdict) in catalyst, and `VarkaSizeLadderJitSuite` (whether stock Spark's consume method compiles past `HugeMethodLimit`) in sql/core. Two more start short children: `VarkaDeoptCycleSuite` runs `dev/varka_deopt_cycle.py`, the nightly's parser of the C2 deoptimization cycle, over recorded logs, and `VarkaVectorTemplateWarmupSuite` asks a `-XX:+PrintFlagsFinal -version` JVM at two and at three processors for its `CICompilerCount`. Each had its own launcher. This PR moves all seven onto `VarkaChildProcess`, the shared test helper that `VarkaHugeMethodSuite`, `VarkaSplitInliningSuite`, `VarkaAssemblySuite` and `VarkaWidthAuditSuite` already use. What the helper gives each child, recapped so this description stands alone: - `VarkaChildProcess.javaCommand(flags, mainClass, arguments)` builds the command: this JVM's `java`, `--add-modules jdk.incubator.vector`, `--enable-native-access=ALL-UNNAMED`, the suite's flags, the test classpath, the main class and its arguments. The suites pass the flags they passed before. `VarkaSizeLadderJitSuite` passes Spark's launcher module options among them. The census's `-XX:+PrintFlagsFinal -version` query, the template warm-up suite's two `-version` JVMs and the two Python scripts have no main class, so they build their `ProcessBuilder` by hand, with the arguments and environment they had. - `VarkaChildProcess.run(what, builder, budgetSeconds, onLine)` reads the child's output on a reader thread and hands each line to `onLine`, where each suite's parsing stays as it was. Meanwhile the test thread waits for the child to exit. The wait ends on one of three things: the child exits, the budget runs out, or the test thread is interrupted (which is what `VarkaTestWatchdog` does at its cap). On a timeout or an interrupt the child and its descendants are destroyed, and the failure names `what`, the PID and the last 40 lines. `Run.requireSuccess(done)` fails a child that exited non-zero, or exited without the end mark the suite looks for. `VarkaDeoptCycleSuite` does not call it: the parser's exit status of 1 is the guard's verdict, which the tests read from `Run.exitValue` as they read it from the process before. - `what` names the suite, the probe and its case. Examples: "VarkaInliningCliffSuite's probe of 22 outputs at ceiling 400 and call-site budget 0", "VarkaKernelWarmupSuite's warm-up probe of a batch with SOME_NULLS, wide", "VarkaOperatorCensusSuite's fork of long.L2D at 256 bits under [-XX:UseAVX=2]", "VarkaSizeLadderJitSuite's probe of a 80-entry rung", "VarkaDeoptCycleSuite's varka_deopt_cycle.py over cycle.log without --fail-on-cycle", "VarkaVectorTemplateWarmupSuite's CICompilerCount query at 3 processors". - `VarkaChildProcess.budgetSeconds(capMinutes, childrenPerTest)` is the test's watchdog cap less 60 s, divided by the most children one test starts. That way a test's children, each at its full budget, still end before the watchdog acts. The budget arithmetic for each suite, at the default cap of ten minutes: | suite | children per test | budget per child, before -> after | |---|---|---| | `VarkaKernelWarmupSuite` | 1 | 240 s (a killer thread) -> 540 s | | `VarkaSanitizedWarmupSuite` | 1 | 420 s (a killer thread) -> 540 s | | `VarkaSizeLadderJitSuite` | 1 | 600 s, never enforced and past the cap -> 540 s | | `VarkaInliningCliffSuite` | 2 (two probes, or a probe and the Python reader) | 120 s and 60 s, never enforced -> 270 s | | `VarkaDeoptCycleSuite` | 2 (the cycle test parses its log with and without `--fail-on-cycle`) | 60 s, never enforced -> 270 s | | `VarkaVectorTemplateWarmupSuite` | 2 (the CICompilerCount test's JVMs at two and three processors) | 60 s, never enforced -> 270 s | | `VarkaOperatorCensusSuite` | up to 405 (4 at a time on the laptop, 1 at a time on a 4-core runner) | 300 s each -> one 540 s budget per test, shared | The census can't use a fixed share of the cap. Its census test forks one JVM per cell and width: 135 cells at up to three widths. On a four-core runner the pool runs them one at a time, so a fixed share would come to about 2 s per fork. Instead, a `@BeforeEach` sets a deadline of `budgetSeconds(cap, 1)`, and each child gets whatever is left of it. A child asked for after the deadline is not started, and the failure says the test's children have spent their budget, naming that child. With the watchdog off (a cap of 0), the census's children have no budget either. On the post-merge Build of master at d20b73f the census test took 240 s, under half the 540 s. A watchdog interrupt reaches the census's pooled forks as well. It lands on the test thread in `Future.get`, the `finally` block's `pool.shutdownNow()` interrupts the pool threads, and `run` then destroys each running child. `VarkaSizeLadderJitSuite` is in sql/core. It reaches the catalyst helper through sql/core's dependency on catalyst's test classes, the same way it already reached `VarkaTestWatchdog` and `VarkaTestUse`. Each suite drops its own `BufferedReader` loop or `readAllBytes`, its classpath and `java` lookup, its killer thread or its reader thread, and its timeout constant. Row 585's status cell in `sql/varka/plans/m8/PLAN.md` records the build. The helper's class comment now lists the seven suites. The helper's section of `sql/varka/skills/testing-and-debugging.md` gains one sentence on when a test's children share one deadline. ### Why are the changes needed? Six of the seven read the child's output to its end on the test thread, and only then called `Process.waitFor` with a timeout. The output ends only when the child exits, so the timeout could never fire. A hung probe held the test until `VarkaTestWatchdog`'s ten-minute cap. The watchdog's interrupt does not end a read blocked on a pipe, so either the JVM was halted (aborting the shard) or a bare `InterruptedException` surfaced that named no probe. Nothing destroyed the child. The two warm-up suites did have a daemon thread that destroyed the child after its budget, but the failure still said only "the probe did not finish". `VarkaSizeLadderJitSuite`'s 600 s was longer than the cap it had to fit under. The census already drained output on a thread. It destroyed only the child, not its descendants. An interrupt left the child running. And its timeout message named no cell. ### Does this PR introduce _any_ user-facing change? No. Test code only. ### How was this patch tested? On the laptop (AMD Ryzen AI 9 HX PRO 370, AVX-512, the host the committed census was taken on, so the census comparison ran rather than skipped): build/sbt 'catalyst/testOnly *VarkaKernelWarmupSuite *VarkaSanitizedWarmupSuite' build/sbt 'catalyst/testOnly *VarkaInliningCliffSuite *VarkaOperatorCensusSuite *VarkaChildProcessSuite *VarkaEmittedBytesSuite *VarkaCoverageSuite' build/sbt 'sql/testOnly *VarkaSizeLadderJitSuite' build/sbt 'catalyst/testOnly *VarkaDeoptCycleSuite *VarkaVectorTemplateWarmupSuite *VarkaKernelWarmupSuite' catalyst/Test/scalastyle - `VarkaKernelWarmupSuite`: 14 of 14 passed, none cancelled. All five forked verdict tests passed, 1.4 s to 6.9 s each. - `VarkaSanitizedWarmupSuite`: 2 of 2 passed, none cancelled. The probe test took 1.7 s. - `VarkaInliningCliffSuite`: 2 of 2 passed, 5.2 s and 8.5 s. - `VarkaOperatorCensusSuite`: 8 of 8 passed, none skipped. The census and the comparison with `sql/varka/operator_census.json` took 45 s. The host-fact tests took 3 to 4 s. - `VarkaChildProcessSuite`: 5 of 5 passed. - `VarkaEmittedBytesSuite` and `VarkaCoverageSuite`: passed. The three opt-in audits cancelled, as they do unless asked for. - `VarkaSizeLadderJitSuite`: 2 of 2 passed, 8.9 s and 12.0 s. - `VarkaDeoptCycleSuite`: 7 of 7 passed, each test under 0.2 s, its exit statuses read as before (1 for a cycle, an empty log or an unfinished fork; 0 otherwise). - `VarkaVectorTemplateWarmupSuite`: 12 of 12 passed. The CICompilerCount test, whose two `-version` JVMs now go through the helper, took 0.1 s and runs right after the test that sets and clears the thread's interrupt flag, so the helper's wait saw a clean flag. - `VarkaKernelWarmupSuite`, rerun after merging master into the branch beside the two: 14 of 14 passed. To check the failure path, `VarkaInliningCliffSuite` and `VarkaOperatorCensusSuite` were run under `set Test/javaOptions += "-Dvarka.test.watchdog.minutes=1"`, which leaves a 1 s budget. The cliff suite failed with "VarkaInliningCliffSuite's probe of 16 outputs at ceiling 400 (pid 1813189) did not finish within 1 s and was destroyed; its last lines: ...". The census failed with, for example, "VarkaOperatorCensusSuite's fork of long.L2D at 256 bits under [] was not started: the test's children have spent their budget of 1 s". No probe process was left running after either run. Also run: `dev/varka_precommit.sh` (through the commit hook), `catalyst/Test/scalastyle` and `sql/Test/scalastyle`, and `dev/lint-java`. `dev/varka_regen_generated.sh --all` changed no generated file, and `dev/varka_push_check.py` passed (425 counted lines). The probes' command lines and their parsing are unchanged, apart from the census's host-fact probe, which now also gets `--enable-native-access=ALL-UNNAMED`. ### Accepted trade-offs - **The one-child suites now allow 540 s where the warm-up suites allowed 240 s and 420 s**, because the budget comes from the cap rather than being chosen per suite. A hung warm-up probe therefore takes longer to fail. On the laptop its probes take 2 to 7 s. - **The census shares one deadline per test rather than counting its children.** That deadline is a static field set in `@BeforeEach`, which suits a JUnit suite whose tests run one at a time. It stays inside the suite rather than becoming a helper API, because no other suite starts a variable number of children. - **The Python log reader in `VarkaInliningCliffSuite` goes through the JVM helper**, so it is marked as a child JVM in the class-use record. Its test already starts a probe JVM, so the record does not change. - **Each Scala suite still declares its own one-line `childBudgetSeconds`** rather than getting one from `VarkaTestWatchdog`, as the four suites of the earlier change do. That keeps the per-suite child count next to its reason. - **`VarkaVectorTemplateWarmupSuite`'s CICompilerCount test is now marked a child-JVM test in the class-use record**, because the helper marks every child it starts. Its `-version` JVMs run no Varka code, so the record now keeps that test wherever any class changes, where before it could leave it out; the test costs two short JVMs. `VarkaDeoptCycleSuite` already marked its parser that way, so its record does not change. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
…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)
No description provided.