Skip to content

Restore the ITensors.jl cross-check and key the results by measured revision - #8

Merged
shinaoka merged 3 commits into
mainfrom
julia-cross-check
Oct 10, 2026
Merged

shinaoka merged 3 commits into
mainfrom
julia-cross-check

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Two changes that make the recorded results reachable and independently checkable.

1. ITensors.jl cross-check for the MPO contraction inputs

julia/ and its three checks were deleted in 9ea63f1 ("Consolidate benchmarks
around interpolative Gaussian inputs"), which also replaced the Gaussian input
family. The export half survived but had no consumer left, so nothing recorded
had been read back by an implementation other than the one that wrote it.

Restored for case 3, adapted to the current instance definition:

  • mpo_mpo_aniso_patched honours EXPORT_HDF5=<dir> and writes
    instance-n<N>.h5 (the fused site-dimension-4 QTTs as ITensorMPS MPS groups
    f and g) plus instance-n<N>.json (the two analytic mixtures, the box,
    r and the tolerances).
  • julia/check_mpo_mpo.jl reads that pair, asserts the case name first because
    the Gaussian cases once shared these file names, evaluates both tensors at 50
    sampled fused grid points each, and compares with the closed form
    f(x, y) = sum_i w_i exp(-(a_i dx^2 + 2 b_i dx dy + c_i dy^2)).

Measured on this machine at the new pin:

instance max relative deviation gate
n = 2 4.81e-06 1e-04
n = 8 8.72e-06 1e-04
n = 32 9.18e-06 1e-04

The deviation is the scale of the 1e-6 input truncation, so the check catches
a broken export or a wrong fused-index convention rather than bounding accuracy.
It is not vacuous: re-running n = 8 with CHECK_THRESHOLD=1e-9 fails on the
first sampled point.

CI installs Julia and runs the check on the N = 2 smoke instance, which the
smoke step now exports.

Case 1 still honours EXPORT_HDF5 but has no checker; its old
check_elementwise.jl is not restored here.

2. Results keyed by the measured revision, with a generated index

There was one directory per machine, overwritten by the next sweep, so an older
sweep could not be linked to at all. Results now follow tprims-benchmark:

result/INDEX.md                       generated table of contents
result/<profile>/<rev12>/run.yaml     machine, source and tensor4all-rs revision, threads, CPU set
result/<profile>/<rev12>/raw/*.json   one record per case, arm and instance
result/<profile>/<rev12>/report.md    generated from those records
  • scripts/run_all.sh reads the revision from the Cargo.toml pin, so the
    recorded revision, the directory and the built code cannot disagree, and it
    regenerates the index at the end.
  • scripts/gen_index.py writes result/INDEX.md and has a --check mode that
    CI runs. The index sorts by date, links each sweep's report, counts its
    records, and marks a row current or superseded against the pin.
  • The committed sweeps were moved under their measured revision:
    linux-epyc-7713p/9e9aedaebe0d/ and a5157385f580/ for the two Ryzen
    profiles. No record was edited.

The README now opens on the index instead of a hand-written table that could go
stale.

Validation

cargo fmt --all -- --check, cargo clippy --locked --all-targets -- -D warnings,
cargo test --release --locked (22 passed), python3 scripts/report.py on each
of the three sweeps, python3 scripts/gen_index.py --check, git diff --check,
and julia --project=julia julia/check_mpo_mpo.jl on the exported n = 2, 8, 32
instances.

@shinaoka
shinaoka merged commit 117bca3 into main Oct 10, 2026
1 check passed
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.

1 participant