Skip to content

Document SpinGlassPEPS integration architecture#41

Open
bernalde wants to merge 3 commits into
mainfrom
docs/issue-35-spinglasspeps-design
Open

Document SpinGlassPEPS integration architecture#41
bernalde wants to merge 3 commits into
mainfrom
docs/issue-35-spinglasspeps-design

Conversation

@bernalde

@bernalde bernalde commented May 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a SpinGlassPEPS integration architecture page to the generated docs.
  • Records the planned optional structured-graph PEPS backend boundary, dependency policy, data/result model adapters, backend selection shape, staged PR plan, non-goals, and risks.
  • Links the new page from the Documenter navigation and updates the docs guide page list.
  • Merges current origin/main so the PR no longer carries the out-of-scope one-variable solver change.

Tests run

  • git diff --check origin/main...HEAD - passed.
  • julia +1.12 --project=docs/ -e 'using Pkg; Pkg.instantiate()' - passed.
  • julia +1.12 --project=docs/ docs/make.jl - passed; deployment skipped outside CI.
  • julia +1.12 --project=. -e 'using Pkg; Pkg.test(; coverage=false)' - passed.

Notes

  • The current diff is docs-only.
  • The one-variable solver fix is now supplied by main, not by this PR.

Closes #35

@bernalde bernalde left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Blocking issues: none found in the changed documentation.

Nonblocking issues: none found.

Questions: none.

Tests run and outcomes:

  • julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' passed.
  • julia --project=docs/ docs/make.jl local passed, including doctests and cross-reference checks.
  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' passed.
  • julia +1.10 --project=. -e 'using Pkg; Pkg.test()' did not reach test execution locally because the root manifest was resolved with Julia 1.12.6 and Pkg could not locate OpenSSL_jll under Julia 1.10.11.
  • The PR CI LTS Ubuntu job is failing in the existing QUBODrivers fixed-variable suite when TenSolver.Optimizer is exercised on a one-variable model; ITensorMPS.dmrg errors that system size 1 is unsupported. The documentation job passed.

Merge as-is: not while the required test workflow is red. I did not find a PR-diff issue that needs an inline comment, but this should get a green test run or an explicit maintainer decision on the unrelated LTS failure before merge.

@bernalde

Copy link
Copy Markdown
Member Author

Reviewed the PR feedback.

Commits pushed:

  • None. There were no actionable comments on the changed documentation.

Main changes made:

  • No file changes. The only review comment reports no blocking or nonblocking issues in the docs diff.

Tests run:

  • No new local tests were run because no code or documentation changes were made in response to the review.
  • Existing validation from the PR remains: docs build and Documenter doctests passed locally, and julia +1.12 --project=. -e 'using Pkg; Pkg.test()' passed locally.
  • Current PR checks: documentation build passed; documenter/deploy passed; the test workflow is red after Julia lts - ubuntu-latest - x64 failed and the remaining matrix jobs were cancelled by fail-fast.

Comments intentionally not addressed:

  • The review's CI note is not being fixed in this docs-only PR. The failure is in the existing QUBODrivers fixed-variable contract path for a one-variable model, where ITensorMPS.dmrg errors because system size 1 is unsupported. Fixing that requires a solver/optimizer behavior change outside the scope of issue [SpinGlassPEPS 1/6] Document integration architecture and backend boundary #35 and this documentation-only PR.

Remaining risks or follow-up:

  • This PR remains blocked if the required test workflow must be green before merge. The follow-up should be a separate code PR for the one-variable/fixed-variable optimizer edge case, or an explicit maintainer decision to merge this docs-only PR despite the unrelated red test workflow.

@bernalde

Copy link
Copy Markdown
Member Author

Pushed the requested CI fix.

Commits pushed:

  • 753ff05 - Fix one-variable solver edge case (#35)

Main changes made:

  • Added an exact one-variable path in src/solver.jl so system-size-1 QUBO/PUBO/optimizer reductions do not call DMRG.
  • Added regression coverage in test/qubo.jl for one-variable minimization, linear+constant terms, degeneracy, and maximization.

Tests run:

  • julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' passed.
  • julia --project=docs/ docs/make.jl local passed.
  • julia +1.12 --project=. -e 'using Test, Random, LinearAlgebra, TenSolver; include("test/utils.jl"); include("test/qubo.jl")' passed, 82 tests.
  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' passed.
  • julia +1.10 --startup-file=no -e 'using Pkg; Pkg.activate(; temp=true); Pkg.develop(PackageSpec(path=pwd())); Pkg.add(["Aqua", "JuMP", "QUBODrivers"]); using Test, TenSolver; include("test/external.jl")' passed: QUBODrivers 130/130 and Aqua 11/11.
  • PR CI rerun is green across the test matrix and docs.

Comments intentionally not addressed:

  • None remaining. There were no inline review comments.

Remaining risks:

  • The one-variable path returns one exact stats entry rather than a DMRG sweep history, which is intentional because no DMRG run exists for system size 1.

@bernalde bernalde left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

GitHub rejected an APPROVE review from this authenticated account because it is the PR author, so this is submitted as a COMMENT review. The maintainer recommendation is still merge-ready as-is.

  1. Blocking issues: none.
  2. Nonblocking issues: none.
  3. Questions: none.
  4. Tests run and outcomes:
    • git diff --check origin/main...HEAD: passed.
    • julia +1.12 --project=. -e 'using Test, Random, LinearAlgebra, TenSolver; include("test/utils.jl"); include("test/qubo.jl")': passed, 82 tests.
    • julia --project=docs/ docs/make.jl local: passed.
    • julia +1.12 --project=. -e 'using Pkg; Pkg.test()': passed.
    • gh pr checks 41 --watch --fail-fast: all PR checks passed across Julia 1, LTS, prerelease, docs build, and Documenter deploy.
  5. Merge recommendation: merge-ready as-is.

@bernalde bernalde left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

GitHub rejected an APPROVE review from this authenticated account because it is the PR author, so this is submitted as a COMMENT review. The maintainer recommendation is still merge-ready as-is.

Blocking issues: none.

Nonblocking issues: none.

Questions: none.

Tests run and outcomes:

  • git diff --check origin/main...HEAD: passed.
  • julia --project=. -e 'using Test, Random, LinearAlgebra, TenSolver; include("test/utils.jl"); include("test/qubo.jl")': passed, 82 tests.
  • julia --project=. -e 'using Pkg; Pkg.test()': passed on Julia 1.11.5.
  • julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()': passed.
  • julia --project=docs/ docs/make.jl local: passed.
  • julia +1.10 --startup-file=no -e 'using Pkg; Pkg.activate(; temp=true); Pkg.develop(PackageSpec(path=pwd())); Pkg.add(["Aqua", "JuMP", "QUBODrivers"]); using Test, Random, LinearAlgebra, TenSolver; include("test/utils.jl"); include("test/qubo.jl"); include("test/external.jl")': passed; QUBO 82/82, QUBODrivers 129/129, Aqua 11/11.
  • One-variable smoke checks for integer QUBO input and single-variable DynamicPolynomials input: passed.

Merge as-is: yes. I found no actionable correctness, API, documentation, or maintainability issues in this PR.

@bernalde bernalde left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Senior maintainer review. Note: I am the PR author, so GitHub only permits a COMMENT event from me; a formal approval or change-request must come from another maintainer. No blocking issues; one process item below for the reviewer to decide.

Diff verification: merge-base ca27880; git diff <merge-base>..HEAD --stat = 6 files, +301 / -1, matching the PR's reported totals. Base = main; this is 1/6 of the SpinGlassPEPS stack (issues 35-40).

Issue intent (#35): #35 asks for a documentation-only PR adding the integration design doc, with explicit acceptance criteria "No new runtime dependencies" and "No public TenSolver solver behavior changes," and "Adding backend dispatch" listed out of scope. The design doc itself fully delivers the requested content (solver boundary, optional PEPS backend, DMRG-stays-default, packaging/optionality, staged plan) and is technically accurate against #35 and arXiv:2411.16431. Project.toml/docs/Project.toml deps are unchanged; SpinGlassPEPS is not added.

Nonblocking

  1. Scope: the PR is labeled documentation-only but bundles a real solver behavior change — src/solver.jl:187 adds _single_variable_minimize plus dispatch in _minimize, so minimize/maximize on a 1x1 QUBO now take an exact path instead of calling DMRG (which can't do system size 1). This contradicts #35's "documentation-only / no public behavior change / no backend dispatch" boundary. The PR body discloses it, and the change is correct and test-covered (energies -2.0, -1.0, 2.0 verified; multi-var DMRG path unaffected), so I am not blocking — but the same single-variable fix is also appearing in #32/#33/#34. Recommend peeling it into its own bug-fix PR so the stack base stays doc-only and the fix is reviewed once, on its own merits; or relabel #41 to drop the "documentation-only" framing.

Doc accuracy and wiring (verified, all correct): claims about optional structured-graph backend, DMRG default, SpinGlassPEPS reexports, PEPS+boundary-MPS+B&B, Julia 1.11/GPU footprint, and the 6-PR plan all match #35. The new page is registered in docs/make.jl, docs/src/index.md, and docs/DOCUMENTATION.md; all three @ref links (minimize, maximize, Solution) resolve; the only external link is the valid arXiv URL.

Question
2. Closes #35 is appropriate here — #35 is the design-doc issue, not the umbrella epic, so closing it on merge does not prematurely close issues 36-40. Confirmed; no action needed.

Tests/build run (Julia 1.10.11):

  • julia --project=docs -e 'Pkg.develop(path=pwd()); Pkg.instantiate()' — passed.
  • julia --project=docs docs/make.jl — passed: Doctest, ExpandTemplates, CrossReferences, CheckDocument, Render all completed; only the benign "skipping deployment" notice (expected locally). The new page rendered.
  • Targeted solver smoke test (multi-var DMRG path + the three single-variable paths) — all correct, matching test/qubo.jl expectations. I did not run full Pkg.test() here; the targeted run confirms the solver change is non-regressing.

Merge readiness: The docs portion is ready — accurate, complete against #35, properly wired, builds cleanly, links resolve. The one item for the reviewer is the scope question: the PR ships a solver change under a documentation-only label. The code is correct and tested, so it is not a technical blocker, but consider splitting it out to keep the stack base clean. The formal verdict must come from another maintainer.

Comment thread src/solver.jl
return _minimize(H, cte, a -> p(vs => a); cutoff, kwargs...)
end

function _single_variable_minimize(::Type{T}, sites, obj, initial_time; device, verbosity, on_iteration, callback_every) where {T}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nonblocking (scope): this exact single-variable path is a real solver behavior change in a PR labeled documentation-only, contradicting issue #35's "no public behavior change / no backend dispatch" boundary. It's correct and tested, so not a blocker — but the same fix also appears in #32/#33/#34. Consider peeling it into its own bug-fix PR so the stack base stays doc-only, or relabel this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in 3f94383. Merging current origin/main removed the solver/test changes from this PR diff, so #41 is docs-only and the one-variable fix now comes from main.

@bernalde bernalde left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Senior maintainer review of PR #41 ("Document SpinGlassPEPS integration architecture"). Reviewed on its own merits only, not the downstream stack. Author is my own posting identity, so GitHub forbids APPROVE/REQUEST_CHANGES from me; this is submitted as COMMENT. A formal approving/blocking verdict must come from another maintainer.

The documentation itself is accurate and well framed. The new page repeatedly uses "planned", "should", and an explicit disclaimer that it "is a design note for the implementation stack, not a description of behavior available in the current TenSolver release." Claims I spot-checked against the code hold: Julia 1.10 support (julia = "1.10" in Project.toml), MPO+DMRG over Boolean qudit sites, Solution wrapping the MPS plus convergence traces, PUBO via MultivariatePolynomials, and the QUBOTools SampleSet optimizer result. The @ref targets minimize, maximize, and Solution are all documented in docs/src/api.md, so cross-references resolve. The documenter/deploy check passed against this exact head SHA (PR41 preview built). Navigation and @contents updates are consistent.

The problems are about scope and base freshness, not the prose.

Blocking

  1. Out-of-scope code change duplicates work already on main. This PR is supposed to be documentation-only (issue #35: "This PR should be documentation-only"; Out of scope explicitly lists "Adding backend dispatch"). But it also modifies src/solver.jl (+35) and test/qubo.jl (+36) to add the one-variable QUBO fix (_single_variable_minimize). That same fix is already on origin/main via PR #48 (commit 61c8def, "fix: handle one-variable QUBOs"). The added code and tests are byte-for-byte identical to what main already contains. The reason it is here is that this branch was cut from old main (merge-base ca27880) before #48 landed. Net effect on a docs-only PR: it carries a redundant code change that does not belong to issue #35, muddying the "documentation-only" contract and the diff. Fix: rebase this branch onto current origin/main (9a3dd5c) and drop the src/solver.jl and test/qubo.jl changes so the PR contains only the four docs files. After rebasing they should disappear from the diff since they are identical to main.

  2. Closes #35 on a documentation-only PR is appropriate here, with one caveat. Issue #35 explicitly scopes itself to the design document only (acceptance criteria: "A design document is added ...", "No new runtime dependencies", "No public TenSolver solver behavior changes"; out of scope: implementing conversions/dispatch). So Closes #35 is the correct linkage for this docs page and is not a mis-closure of an implementation request. This is downgraded from a closure-correctness block, but it interacts with item 1: the PR currently DOES change public solver behavior (the one-variable path), which violates issue #35's own acceptance criterion "No public TenSolver solver behavior changes." Removing the code change per item 1 resolves both. No action needed on the Closes keyword itself once the diff is docs-only.

Nonblocking

  1. Stale base. The branch is 5 commits behind origin/main (cut from ca27880; main is at 9a3dd5c, v0.2.0; this head still has version = "0.1.0" in Project.toml). Rebasing onto current main is needed anyway for item 1 and matches the branch-hygiene note on issue #35 ("Keep the PR ... based on the repository default branch (main) after fetching and fast-forwarding").

  2. PR description "Tests run" section lists running the full test suite and the one-variable QUBO assertions. For a docs-only PR (post-rebase) those become irrelevant; trim the description so it reflects the actual docs change and records the Documenter build as the relevant check.

Questions

  1. The page asserts "SpinGlassPEPS 1.5.0 declares Julia 1.11 compatibility" and unit-cell sizes "up to 24 spins for Pegasus and 16 spins for Zephyr." These are external-version-specific facts that will drift. Are they pinned to a SpinGlassPEPS release you have verified, and is it worth softening to "at the time of writing" so the doc does not silently go stale?

Doc build / tests

I could not run the Documenter build locally: the review sandbox denied git clone, repo tarball download, and writing the cloned tree under /tmp (julia 1.10.11 is present, but there was no checked-out tree to build, and +1.12 is not installed here). Falling back to CI: the documenter/deploy check is green against head 753ff05 and published the PR41 preview, so the doc build is healthy. All 11 CI jobs (Julia 1/lts/pre on ubuntu/macOS/windows, build, documenter) pass.

Summary

  1. Blocking: (a) docs-only PR carries a redundant src/solver.jl+test/qubo.jl one-variable fix already present on main via #48 - rebase onto current main and drop it; this also restores compliance with issue #35's "No public solver behavior changes" criterion.
  2. Nonblocking: stale base (5 behind, version still 0.1.0) - rebase; PR description test list no longer matches a docs-only change.
  3. Questions: external version/topology facts (SpinGlassPEPS 1.11 compat, Pegasus/Zephyr spin counts) may go stale - consider "at time of writing".
  4. Tests/doc-build: local Documenter build not run (sandbox denied clone/tarball/tree write); relied on CI - documenter/deploy green on head 753ff05, all checks pass.
  5. Merge-readiness: the documentation content is accurate and ready, but the diff is not docs-only as intended. I would not merge this until the blocking issues above are addressed. Formal verdict to be recorded by another maintainer.

@bernalde

Copy link
Copy Markdown
Member Author

Commits pushed:

  • 3f94383 Merge remote-tracking branch origin/main into docs/issue-35-spinglasspeps-design

Main changes made:

  • Merged current origin/main into Document SpinGlassPEPS integration architecture #41 without rewriting history.
  • Removed the out-of-scope solver/test changes from the PR diff by taking the solver fix from main.
  • Left the PR diff docs-only: new SpinGlassPEPS integration architecture docs plus documentation navigation updates.
  • Updated the PR body to remove stale solver-scope wording.

Tests run and results:

  • git diff --check origin/main...HEAD passed.
  • julia +1.12 --project=docs/ -e 'using Pkg; Pkg.instantiate()' passed.
  • julia +1.12 --project=docs/ docs/make.jl passed; deployment was skipped outside CI.
  • julia +1.12 --project=. -e 'using Pkg; Pkg.test(; coverage=false)' passed.

Comments intentionally not addressed:

  • None. The scope comment was addressed by making the PR docs-only.

Remaining risks or follow-up items:

  • GitHub CI for 3f94383 is still running.

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.

[SpinGlassPEPS 1/6] Document integration architecture and backend boundary

1 participant