Skip to content

[tutorials] Remove dead test-dependency variables - #23019

Open
kutsibalci wants to merge 1 commit into
root-project:masterfrom
kutsibalci:tutorials-remove-dead-depends
Open

[tutorials] Remove dead test-dependency variables#23019
kutsibalci wants to merge 1 commit into
root-project:masterfrom
kutsibalci:tutorials-remove-dead-depends

Conversation

@kutsibalci

Copy link
Copy Markdown
Contributor

Four <tname>-depends variables in tutorials/CMakeLists.txt are never read, so the test ordering they describe is not applied. This removes them.

How the variables are consumed

They are read only as ${${tname}-depends}, at four places (lines 758, 789, 1059, 1060). tname is the tutorial path with its extension stripped and / replaced by -:

string(REPLACE ".py" "" tname ${t})
string(REPLACE "/" "-" tname ${tname})
set(tutorial_name tutorial-${tname}-py)

So a <x>-depends variable has an effect only if some tutorial file resolves to tname <x>.

The four

benchmarks-depends (line 614) — the file is legacy/benchmarks.C, so its tname is legacy-benchmarks, not benchmarks. It is also listed in extra_veto ("These ones are disabled !!!"), so no test is generated for it under either name. Two of its entries are independently stale: tutorial-io-tree-tree120_ntuple.C carries a stray .C that no test name has, and tutorial-io-tree-spider names a tutorial that is no longer in the tree. Introduced in c43f365 (2014), when the file was tutorials/benchmarks.C.

pyroot-benchmarks-depends (line 887) — tutorials/pyroot/ no longer exists; the directory was dissolved in #17208 and there is no pyroot/benchmarks.py.

analysis-unfold-testUnfold7d-depends (line 598) — the unfold series stops at testUnfold7c.C; there is no testUnfold7d.C. Note the neighbouring analysis-unfold-testUnfold5d-depends is kept, because testUnfold5d.C does exist — the asymmetry is real, not a typo.

machine_learning-TMVA_SOFIE_RDataFrame-py-depends (line 859) — this is the only -py-depends in the file. tname never ends in -py: the suffix is appended to tutorial_name, not to tname, and no tutorial file is named *-py.py. The dependency it asks for is nevertheless already in effect, because the Python tutorial reads machine_learning-TMVA_SOFIE_RDataFrame-depends, set unconditionally at line 665 to tutorial-machine_learning-TMVA_SOFIE_PyTorch_HiggsModel-py — already correctly suffixed.

I checked that last one against CMake rather than trusting the reading, with a minimal project reproducing the idiom verbatim:

-- tname          = machine_learning-TMVA_SOFIE_RDataFrame
-- tutorial_name  = tutorial-machine_learning-TMVA_SOFIE_RDataFrame-py
-- lookup key     = machine_learning-TMVA_SOFIE_RDataFrame-depends
-- the -py-depends variable holds = 'tutorial-machine_learning-TMVA_SOFIE_PyTorch_HiggsModel'
-- RESULT: DEPENDS of tutorial-machine_learning-TMVA_SOFIE_RDataFrame-py
           = 'tutorial-machine_learning-TMVA_SOFIE_PyTorch_HiggsModel-py'

The ordering matters here — TMVA_SOFIE_RDataFrame.py raises FileNotFoundError if HiggsModel.onnx is missing — and it is retained by line 665 after this change.

One thing worth flagging separately, which I have not changed: that ordering survives only because TMVA_SOFIE_RDataFrame.C and TMVA_SOFIE_RDataFrame.py collapse to the same tname and therefore share one -depends variable. If the C++ tutorial is ever removed, line 665 would likely go with it and the Python test would lose its dependency silently. Happy to follow up on that if you think it is worth guarding.

What I did not change

I resolved every <tname>-depends variable in the file against the tutorials on disk. The only other candidate the sweep produced was tutorial-machine_learning-TMVA_SOFIE_GNN_Parser inside machine_learning-TMVA_SOFIE_GNN_Application-depends, which is correct: that test does not come from the glob but is added explicitly at line 712 with exactly that name. It is left alone.

After the change the same sweep reports no -depends variable whose owner is missing, and no list entry naming a nonexistent test other than the explicitly-added one above.

Checks

  • if/endif counts drop by exactly one each (the removed if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND) block) and parentheses stay balanced; foreach/endforeach are untouched.
  • Deletions only: +0/-21, one file.
  • Branched from current master so it applies fast-forward.

No test loses a dependency it was actually getting.

AI disclosure

AI-assisted (Claude Code). The tool was used to run the sweep described above, to build the minimal CMake reproduction, and to draft this description. The findings were checked before opening: the consumption sites and tname derivation were read in the file, each missing tutorial was confirmed absent from the tree, the blame commits were looked up, and the one false positive was identified and excluded. I have reviewed and understood the change and take responsibility for it.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 15h 44m 4s ⏱️
 3 857 tests  3 857 ✅ 0 💤 0 ❌
79 465 runs  79 465 ✅ 0 💤 0 ❌

Results for commit 2501c02.

♻️ This comment has been updated with latest results.

Four `<tname>-depends` variables in tutorials/CMakeLists.txt are never
read by CMake, so the test ordering they describe is not applied.

The variables are consulted only as `${${tname}-depends}`, where `tname`
is the tutorial path with its extension stripped and `/` replaced by
`-`. A variable therefore has an effect only if a tutorial file resolves
to its name.

- `benchmarks-depends`: the file is `legacy/benchmarks.C`, so its tname
  is `legacy-benchmarks`. It is also listed in `extra_veto`, so no test
  is generated for it at all. Two of its entries are stale on top of
  that: `tutorial-io-tree-tree120_ntuple.C` carries a stray `.C`, and
  `tutorial-io-tree-spider` names a tutorial that no longer exists.

- `pyroot-benchmarks-depends`: `tutorials/pyroot/` was dissolved when
  the pyroot tutorials were moved, and no `pyroot/benchmarks.py`
  remains.

- `analysis-unfold-testUnfold7d-depends`: the unfold series stops at
  `testUnfold7c.C`; there is no `testUnfold7d.C`. The parallel
  `testUnfold5d` variable is kept, because that tutorial does exist.

- `machine_learning-TMVA_SOFIE_RDataFrame-py-depends`: `tname` never
  ends in `-py`, because the `-py` suffix is appended to `tutorial_name`
  and not to `tname`, and no tutorial file is named `*-py.py`. The
  ordering it asks for is already in place: the Python tutorial reads
  `machine_learning-TMVA_SOFIE_RDataFrame-depends`, which is set
  unconditionally a few hundred lines earlier and already names the
  producer with its `-py` suffix. Removing the unread variable does
  not change the dependency the test ends up with.

No test loses a dependency it was actually getting.
@kutsibalci
kutsibalci force-pushed the tutorials-remove-dead-depends branch from dd9e477 to 2501c02 Compare August 9, 2026 20:09
@kutsibalci

Copy link
Copy Markdown
Contributor Author

Thanks for approving the workflow. The run went red on 11 Linux jobs, but the failures are stale-build-tree errors, not something this diff can reach. Flagging the evidence rather than leaving it unexplained.

The run was queued on 5 August and only executed on 9 August, so it restored a four-day-old incremental build tree. Two failure signatures, both from that tree:

  • 10 jobsalma8, alma9 Debug, alma9 modules_off, alma10, alma10 arm64, alma10 asan, alma10 minimal build, alma10 benchmark build, opensuse16 march_native, ubuntu22 imt=Off. All ten fail identically:
    Error copying directory from ".../build/include/vdt" to ".../build/ginclude/vdt"
    builtins/vdt/CMakeFiles/BUILTIN_VDT.dir/build.make:98: ...BUILTIN_VDT-copy2externals Error 1.
    The later Install and Build post-install test project steps fail as a consequence: nothing got installed, so find_package(ROOT) finds no ROOTConfig.cmake.
  • 1 jobdebian13 dev=ON, -Wsuggest-override:
    module file '.../lib/std.pcm' is out of date and needs to be rebuilt: signature mismatch, while generating G__ROOTGeomViewer.cxx.

Neither is reachable from this change. The diff removes four set() variables from tutorials/CMakeLists.txt; both failures occur in builtins/vdt and in the C++ modules layer, long before tutorials/ is configured. Where the build did complete, Test Results is green — 3 813 tests, 0 failures, 43 569 runs.

To get a run from a fresh artifact, I have rebased onto current master (52866aea). The rebase is content-identical: the only difference against the previous head is master's own removal of the ml_dataloader_XGBoost.py veto block, and the diff is still tutorials/CMakeLists.txt +0/-21.

AI disclosure: the log analysis above and the wording of this comment were AI-assisted (Claude Code). The job logs and the diff were read before posting, and I take responsibility for the claims.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants