Skip to content

Follow-up to #29504: detach csharp/js consumers + harden doc build + track QNN materialize deps - #29577

Merged
titaiwangms merged 6 commits into
mainfrom
csharp-node-test-detach-followup
Jul 27, 2026
Merged

Follow-up to #29504: detach csharp/js consumers + harden doc build + track QNN materialize deps#29577
titaiwangms merged 6 commits into
mainfrom
csharp-node-test-detach-followup

Conversation

@titaiwangms

@titaiwangms titaiwangms commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the merged #29504 (ONNX node-test detachment). This PR consolidates all post-#29504 follow-up work into a single change set. Changes C/D/E address @tianleiwu's non-blocking post-merge review comments; A/B were the original scope of this PR. None change the behavior of the shipped feature — this is hardening + hygiene + doc detachment.

(A) C# — loud-fail guard on the macOS node-test symlink

csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh symlinked the ONNX on-disk node-test corpus. Once the onnx pin advances past onnx/onnx#7959 (which deletes that corpus) the symlink target vanishes and the suite would silently pass with zero cases. Added a loud-fail guard: enforce a discovered-case floor (1000) and keep the immutable v1.13.1 pin, so corpus absence becomes a red instead of a silent-green.

(B) JS — post-#7959 opset caveat in prepare-onnx-node-tests.ts

Documented that once onnx ships without the on-disk node-test data (onnx/onnx#7959), post-#7959 opsets cannot use the rel-* archive download path — a caveat for the next opset bump.

(C = N1) cmake — drop no-op ctest DEPENDS + document real ordering

cmake/onnxruntime_unittests.cmake: the two set_tests_properties(... PROPERTIES DEPENDS onnx_node_tests_materialized) calls named an add_custom_target(... ALL), not a registered test, so a CTest test-level DEPENDS on it is a silent no-op. Removed both and documented the real ordering guarantee: the ALL target materializes the corpus during the build (before ctest), and the -m / --min-cases tripwire fails loud on a missing/partial corpus.

(D = N2) conf.py — hermetic in-memory doc model

docs/python/conf.py urlretrieved .../node/test_sigmoid/model.onnx from GitHub at doc-build time — a latent 404 once onnx/onnx#7959 deletes that path. Replaced with an in-memory onnx.helper single-node Sigmoid graph (input x → output y, float32 [3,4,5]) written to the same destination. Keeps the doc build hermetic and drop-in compatible.

(E = N3-5) requirements file for QNN/Android materialize deps + SKILL.md

The four QNN/Android CI legs used inline pip install onnx==... "numpy==...; ..." pins (invisible to Dependabot) to feed the onnxruntime_MATERIALIZE_ONNX_NODE_TESTS gate. Added a dedicated minimal requirements-materialize-onnx-node-tests.txt (onnx + numpy only, with hybrid numpy env markers 2.2.6 for python_version<'3.11', 2.4.2 for >='3.11') and repointed all four legs to pip install -r (preserving --user on linux + android; the two Windows legs omit it). Placed at the repo root because dependabot.yml pins pip to directory: "/" (non-recursive). Pins stay locked in lockstep with the CMake gate, which HARD-FATALs on installed != pinned. Updated the onnx-opset-bump-checklist SKILL.md gotcha-p to reflect the new file (reversing its prior "inline by design" note) and added it to the numpy pin sync-site list.


Consolidates the standalone #29746 (now closed) per author request. Triple-review passed on both change sets independently. Merge after #29504 (already merged), which this references.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds safeguards and documentation to prevent silent-green outcomes when ONNX node test corpora disappear post-onnx/onnx#7959, covering remaining non-C++ consumers (C# NuGet macOS leg and JS multi-opset node-test prep).

Changes:

  • C#: Add a fail-loud minimum-case tripwire after symlinking onnx/backend/test/data/node into models/opset${N} to prevent “0 tests run” silent-green when the corpus is missing/truncated.
  • JS: Document that future opsets (post-onnx/onnx#7959 removal of data/node) can’t be added via the existing rel-* archive download mechanism without a new materialization approach.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh Adds a post-symlink corpus-size guard to fail loudly if node test data collapses (avoids silent-green).
js/scripts/prepare-onnx-node-tests.ts Adds an inline note documenting the post-onnx/onnx#7959 constraint for extending opset coverage via rel-* archives.

Comment thread js/scripts/prepare-onnx-node-tests.ts Outdated
Comment thread csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh
@titaiwangms

Copy link
Copy Markdown
Contributor Author

Review team review (full 5-reviewer team)

Ran the full team (readability / code / critical / deep / integration). Clean and ready — no merge-blocker.

Load-bearing facts independently verified: 1097 node cases @ v1.13.1 (gh api repos/onnx/onnx/git/trees/v1.13.1?recursive=1), opset18 resolution, InferenceTest.netcore.cs:457 globs opset*/, and find -L behaves correctly across all four cases (healthy / dangling symlink / empty dir / non-test children). set -x -e is safe (pipeline ends in tr, no pipefail).

Findings

🟠 Major (merge-order dependency, documented). Comments and error messages here cite gotcha (p), ORT_ONNX_NODE_MIN_CASES, and materialize_onnx_node_tests.py — all of which exist only on #29504's branch. So #29577 must merge after #29504 for these references to resolve. The PR body already acknowledges the SKILL.md deferral, so this is a documented stacking dependency, not a defect — just respect the order.

⚪ Non-finding (false positive). One reviewer flagged android-arm64 / linux-qnn ymls still pointing at the old cmake/external/onnx/.../data/node path — but those are repointed by #29504 (the reviewer swept main without #29504 applied). Together the two PRs cover them.

🟡 Minors:

  • Floor could be exact -ne 1097 (v1.13.1 is an immutable tag) instead of -lt 1000, which tolerates 1000–1096 truncation. Low priority.
  • JS NOTE(#7959) comment sits mid-loop; it reads better immediately above the TEST_DATA_OPSET_VERSIONS declaration.
  • The C# guard doesn't state why it's macOS-only.
  • "DELETES" is present-tense for an unmerged PR (Add transformers tool test to pipeline #7959 is still open) — cosmetic.

❓ Open question (needs-run, non-blocking). Does xUnit silently pass a zero-row [Theory] (making the guard necessary) or fail with "No data found" (making it defense-in-depth)? The guard is safe either way, so not worth spinning up a dotnet C# harness on macOS/Linux to resolve.

Bottom line

Clean modulo respecting the merge order (land after #29504). Nothing here blocks.

titaiwangms and others added 4 commits July 16, 2026 21:37
…reen if onnx pin bumps past #7959

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… for QNN materialize deps, cmake ctest comment (#29504 follow-up)

Follow-up to merged #29504 addressing tianleiwu's non-blocking post-merge
review comments.

N1 (cmake): Drop the two no-op `set_tests_properties(... DEPENDS
onnx_node_tests_materialized)` calls. That name is an add_custom_target(... ALL),
not a registered test, so a ctest test-level DEPENDS on it is a silent no-op.
Replace each with a comment documenting the real ordering guarantee: the ALL
target materializes the corpus during the normal build (before ctest), and the
-m / --min-cases tripwire fails loud on a missing/partial corpus.

N2 (conf.py): Replace the doc-build-time urlretrieve of
onnx/backend/test/data/node/test_sigmoid/model.onnx with an in-memory
onnx.helper Sigmoid graph (input "x" -> output "y", float32 [3,4,5]) saved to
the same destination. Removes the network dependency and the latent 404 once
onnx/onnx#7959 deletes that on-disk corpus; keeps the doc build hermetic.

N3-5 (requirements file): Add a dedicated minimal
requirements-materialize-onnx-node-tests.txt (onnx + numpy only, with the hybrid
numpy env markers: 2.2.6 for python_version<'3.11', 2.4.2 for >='3.11'). Repoint
the four QNN/Android CI legs from inline pip pins to `pip install -r` (preserving
--user on the linux + android legs; the two Windows legs omit it). Placed at the
repo root so Dependabot (pip directory: "/") can track the onnx/numpy upgrades
without dragging the heavy docker requirements.txt onto the QNN legs. Pins stay
locked in lockstep with the CMake gate, which HARD-FATALs on installed!=pinned.
Update the onnx-opset-bump-checklist SKILL.md gotcha-p to reflect the new
requirements file (reversing its prior "inline by design" note) and add it to the
numpy pin sync-site list.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@titaiwangms
titaiwangms force-pushed the csharp-node-test-detach-followup branch from 366e3f7 to d7d8b84 Compare July 16, 2026 21:37
@titaiwangms titaiwangms changed the title Follow-up (#29504): guard C# node-test symlink against silent-green + document JS post-#7959 opset constraint Follow-up to #29504: detach csharp/js consumers + harden doc build + track QNN materialize deps Jul 16, 2026
Comment thread docs/python/conf.py Dismissed
Copilot AI and others added 2 commits July 16, 2026 21:54
…rfaced by Optional Lint filter_mode:file

Optional Lint's reviewdog runs with filter_mode:file, which pulls the whole
changed runtest.sh into scope and surfaces 12 legacy INFO/style findings.
Surgical, behavior-preserving fixes:
- SC2086: double-quote single-path/scalar expansions (cd, [ ] test operands,
  csproj paths, -s repo arg). No intended word-splitting changed.
- SC2181: convert the two single-command `$?` checks (dotnet restore, USE_CUDA
  dotnet test) to the direct `if ! cmd; then` form; error messages + exit codes
  preserved verbatim. The final shared check guards the last command of a
  two-branch if/else (USE_TENSORRT or the default run), so it keeps `$?` with a
  scoped `# shellcheck disable=SC2181` explaining why it can't be inlined.

No test logic, dotnet args, paths, or the floor-1000 R1 guard were changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ch-followup

# Conflicts:
#	.github/workflows/windows_qnn_x64.yml
@titaiwangms
titaiwangms requested a review from tianleiwu July 17, 2026 22:07
@titaiwangms
titaiwangms requested a review from gramalingam July 24, 2026 23:03
@titaiwangms
titaiwangms enabled auto-merge (squash) July 27, 2026 17:06
@titaiwangms
titaiwangms merged commit 3463f8c into main Jul 27, 2026
89 checks passed
@titaiwangms
titaiwangms deleted the csharp-node-test-detach-followup branch July 27, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants