You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integration branch: agent_settings (stacked on main).
PR branch receiving the fix: optimize_memory_usage (PR #2 head, based on main).
Problem: PR #2 CI (build (3.12, ubuntu-latest), run 37587323506) fails at
"Run unit tests" with 24 failures, all AttributeError: module 'jax.numpy' has no attribute 'testing' from tests/unit/test_kinetic_density_eq.py.
Root cause: the equivalence test calls jnp.testing.assert_allclose, but jax.numpy exposes no testing submodule (verified on the installed jax
0.10.2: hasattr(jnp, "testing") is False; the attribute does not exist on
any jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclose has the identical signature surface used
here (rtol, atol, err_msg) and accepts JAX arrays through __array__ conversion — no reimplementation needed, no new dependency
(numpy already ships with jax).
The rest of the test (parametrization, reference implementation, precision
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in tests/unit/test_kinetic_density_eq.py:
Add import numpy as np, change jnp.testing.assert_allclose( to np.testing.assert_allclose(.
Style-clean the same file (gate covers changed files): apply black,
add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party grad_dft import, drop trailing
whitespace / missing final newline.
Tests:pytest -v the three unit files CI runs
(test_kinetic_density_eq.py, test_eigenproblem.py, test_loss.py) —
0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:black --check and pylint -rn -sn --rcfile=.pylintrc on the touched file must be clean.
Commit:(#12-S1): use numpy.testing in kinetic density equivalence test
plus a standalone Closes #12, pushed to the PR #2 branch so CI re-runs.
Correct Design: swap to numpy.testing rather than patching around it
or vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for assert_allclose.
Rejected: keeping jnp.testing behind a try/except import shim (hides
the real API location), and jnp.allclose + plain assert (loses the
diff diagnostics err_msg gives for free).
Tolerance note: tests run without jax_enable_x64 (CI and local both
truncate float64 → float32), and all 24 parametrizations pass at rtol=atol=1e-6; no tolerance change was needed.
S1: Implement (numpy.testing swap + style cleanup of the touched file)
Integration branch: agent_settings (stacked on main).
PR branch receiving the fix: optimize_memory_usage (PR #2 head, based on main).
Problem: PR #2 CI (build (3.12, ubuntu-latest), run 37587323506) fails at
"Run unit tests" with 24 failures, all AttributeError: module 'jax.numpy' has no attribute 'testing' from tests/unit/test_kinetic_density_eq.py.
Root cause: the equivalence test calls jnp.testing.assert_allclose, but jax.numpy exposes no testing submodule (verified on the installed jax
0.10.2: hasattr(jnp, "testing") is False; the attribute does not exist on
any jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclose has the identical signature surface used
here (rtol, atol, err_msg) and accepts JAX arrays through __array__ conversion — no reimplementation needed, no new dependency
(numpy already ships with jax).
The rest of the test (parametrization, reference implementation, precision
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in tests/unit/test_kinetic_density_eq.py:
Add import numpy as np, change jnp.testing.assert_allclose( to np.testing.assert_allclose(.
Style-clean the same file (gate covers changed files): apply black,
add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party grad_dft import, drop trailing
whitespace / missing final newline.
Tests:pytest -v the three unit files CI runs
(test_kinetic_density_eq.py, test_eigenproblem.py, test_loss.py) —
0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:black --check and pylint -rn -sn --rcfile=.pylintrc on the touched file must be clean.
Commit:(#12-S1): use numpy.testing in kinetic density equivalence test
plus a standalone Closes #12, pushed to the PR #2 branch so CI re-runs.
Correct Design: swap to numpy.testing rather than patching around it
or vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for assert_allclose.
Rejected: keeping jnp.testing behind a try/except import shim (hides
the real API location), and jnp.allclose + plain assert (loses the
diff diagnostics err_msg gives for free).
Tolerance note: tests run without jax_enable_x64 (CI and local both
truncate float64 → float32), and all 24 parametrizations pass at rtol=atol=1e-6; no tolerance change was needed.
Local vs CI environment pitfall: test_b3lyp fails locally without PYSCF_CONFIG_FILE=.github/workflows/pyscf_conf.py (PySCF then defaults to
the VWN3 RPA variant and the reference energy drifts −23.6/−6.98 kcal/mol,
identical on main) and passes with it set — the env var is part of the
CI job env, so it must be set for any local integration run.
Local OOM pitfall: running all 118 integration tests in one pytest
process trips the OOM killer at ~61%; the workflow's per-file invocations
are load-bearing locally too.
S1: Implement (numpy.testing swap + style cleanup of the touched file) (91f7dd4)
Integration branch: agent_settings (stacked on main).
PR branch receiving the fix: optimize_memory_usage (PR #2 head, based on main).
Problem: PR #2 CI (build (3.12, ubuntu-latest), run 37587323506) fails at
"Run unit tests" with 24 failures, all AttributeError: module 'jax.numpy' has no attribute 'testing' from tests/unit/test_kinetic_density_eq.py.
Root cause: the equivalence test calls jnp.testing.assert_allclose, but jax.numpy exposes no testing submodule (verified on the installed jax
0.10.2: hasattr(jnp, "testing") is False; the attribute does not exist on
any jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclose has the identical signature surface used
here (rtol, atol, err_msg) and accepts JAX arrays through __array__ conversion — no reimplementation needed, no new dependency
(numpy already ships with jax).
The rest of the test (parametrization, reference implementation, precision
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in tests/unit/test_kinetic_density_eq.py:
Add import numpy as np, change jnp.testing.assert_allclose( to np.testing.assert_allclose(.
Style-clean the same file (gate covers changed files): apply black,
add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party grad_dft import, drop trailing
whitespace / missing final newline.
Tests:pytest -v the three unit files CI runs
(test_kinetic_density_eq.py, test_eigenproblem.py, test_loss.py) —
0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:black --check and pylint -rn -sn --rcfile=.pylintrc on the touched file must be clean.
Commit:(#12-S1): use numpy.testing in kinetic density equivalence test
plus a standalone Closes #12, pushed to the PR #2 branch so CI re-runs.
S2: Raise PySCF's memory budget for the CI interpreter
Found after S1: CI progressed past unit tests and failed on tests/integration/solids/test_functional_implementations.py::test_pw92[sol1]
with ValueError: negative dimensions are not allowed.
Diagnosis:pyscf/pbc/df/fft_ao2mo.get_eri computes remaining = mydf.max_memory - current_RSS(); PySCF's default budget
(pyscf/__config__.py: MAX_MEMORY = int(os.environ.get('PYSCF_MAX_MEMORY', 4000)))
is 4000 MB, but the CI process (JAX + TensorFlow + PySCF in one interpreter)
already had RSS ≈ 4297 MB when the last solids test ran → max_memory = -297.44 → negative blksize → numpy.empty raises.
Reproduced locally with PYSCF_MAX_MEMORY=100 (same traceback, max_memory = -853.71). Not related to PR #2's code: a memory-budget env
issue whose trigger depends on allocator variance (today's green run #8
landed under the 4000 MB line).
Code: add MAX_MEMORY = 8000 (with rationale comment) to .github/workflows/pyscf_conf.py — loaded via the job's existing PYSCF_CONFIG_FILE, exec'd after the env read, so it overrides both the
4000 default and PYSCF_MAX_MEMORY. One knob controls PySCF behavior for CI
and for local CI-reproduction. 8000 > observed 4297 MB RSS; pyscf's blksize
math then sizes its ERI buffer ≈ remaining budget (~3.7 GB), keeping total
RSS ≈ 8 GB inside the runner's 16 GB.
Tests: precedence verified
(PYSCF_MAX_MEMORY=100 + PYSCF_CONFIG_FILE → 8000); the CI-failing file
re-run with the config: 8 passed (CI had 1 failed, 7 passed). Other CI
files are unaffected by a budget increase and passed the S1 run.
Docs: module docstring in pyscf_conf.py records the local knob.
Pre-commit check:black --check and pylint -rn -sn --rcfile=.pylintrc
clean on the touched file.
Commit:(#12-S2): give PySCF an 8000 MB budget in the CI config.
Correct Design: swap to numpy.testing rather than patching around it
or vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for assert_allclose.
Rejected: keeping jnp.testing behind a try/except import shim (hides
the real API location), and jnp.allclose + plain assert (loses the
diff diagnostics err_msg gives for free).
Tolerance note: tests run without jax_enable_x64 (CI and local both
truncate float64 → float32), and all 24 parametrizations pass at rtol=atol=1e-6; no tolerance change was needed.
Local vs CI environment pitfall: test_b3lyp fails locally without PYSCF_CONFIG_FILE=.github/workflows/pyscf_conf.py (PySCF then defaults to
the VWN3 RPA variant and the reference energy drifts −23.6/−6.98 kcal/mol,
identical on main) and passes with it set — the env var is part of the
CI job env, so it must be set for any local integration run.
Local OOM pitfall: running all 118 integration tests in one pytest
process trips the OOM killer at ~61%; the workflow's per-file invocations
are load-bearing locally too.
S1: Implement (numpy.testing swap + style cleanup of the touched file) (91f7dd4)
Integration branch: agent_settings (stacked on main).
PR branch receiving the fix: optimize_memory_usage (PR #2 head, based on main).
Problem: PR #2 CI (build (3.12, ubuntu-latest), run 37587323506) fails at
"Run unit tests" with 24 failures, all AttributeError: module 'jax.numpy' has no attribute 'testing' from tests/unit/test_kinetic_density_eq.py.
Root cause: the equivalence test calls jnp.testing.assert_allclose, but jax.numpy exposes no testing submodule (verified on the installed jax
0.10.2: hasattr(jnp, "testing") is False; the attribute does not exist on
any jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclose has the identical signature surface used
here (rtol, atol, err_msg) and accepts JAX arrays through __array__ conversion — no reimplementation needed, no new dependency
(numpy already ships with jax).
The rest of the test (parametrization, reference implementation, precision
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in tests/unit/test_kinetic_density_eq.py:
Add import numpy as np, change jnp.testing.assert_allclose( to np.testing.assert_allclose(.
Style-clean the same file (gate covers changed files): apply black,
add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party grad_dft import, drop trailing
whitespace / missing final newline.
Tests:pytest -v the three unit files CI runs
(test_kinetic_density_eq.py, test_eigenproblem.py, test_loss.py) —
0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:black --check and pylint -rn -sn --rcfile=.pylintrc on the touched file must be clean.
Commit:(#12-S1): use numpy.testing in kinetic density equivalence test
plus a standalone Closes #12, pushed to the PR #2 branch so CI re-runs.
S2: Raise PySCF's memory budget for the CI interpreter
Found after S1: CI progressed past unit tests and failed on tests/integration/solids/test_functional_implementations.py::test_pw92[sol1]
with ValueError: negative dimensions are not allowed.
Diagnosis:pyscf/pbc/df/fft_ao2mo.get_eri computes remaining = mydf.max_memory - current_RSS(); PySCF's default budget
(pyscf/__config__.py: MAX_MEMORY = int(os.environ.get('PYSCF_MAX_MEMORY', 4000)))
is 4000 MB, but the CI process (JAX + TensorFlow + PySCF in one interpreter)
already had RSS ≈ 4297 MB when the last solids test ran → max_memory = -297.44 → negative blksize → numpy.empty raises.
Reproduced locally with PYSCF_MAX_MEMORY=100 (same traceback, max_memory = -853.71). Not related to PR #2's code: a memory-budget env
issue whose trigger depends on allocator variance (today's green run #8
landed under the 4000 MB line).
Code: add MAX_MEMORY = 8000 (with rationale comment) to .github/workflows/pyscf_conf.py — loaded via the job's existing PYSCF_CONFIG_FILE, exec'd after the env read, so it overrides both the
4000 default and PYSCF_MAX_MEMORY. One knob controls PySCF behavior for CI
and for local CI-reproduction. 8000 > observed 4297 MB RSS; pyscf's blksize
math then sizes its ERI buffer ≈ remaining budget (~3.7 GB), keeping total
RSS ≈ 8 GB inside the runner's 16 GB.
Tests: precedence verified
(PYSCF_MAX_MEMORY=100 + PYSCF_CONFIG_FILE → 8000); the CI-failing file
re-run with the config: 8 passed (CI had 1 failed, 7 passed). Other CI
files are unaffected by a budget increase and passed the S1 run.
Docs: module docstring in pyscf_conf.py records the local knob.
Pre-commit check:black --check and pylint -rn -sn --rcfile=.pylintrc
clean on the touched file.
Commit:(#12-S2): give PySCF an 8000 MB budget in the CI config.
Correct Design: swap to numpy.testing rather than patching around it
or vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for assert_allclose.
Rejected: keeping jnp.testing behind a try/except import shim (hides
the real API location), and jnp.allclose + plain assert (loses the
diff diagnostics err_msg gives for free).
Tolerance note: tests run without jax_enable_x64 (CI and local both
truncate float64 → float32), and all 24 parametrizations pass at rtol=atol=1e-6; no tolerance change was needed.
Local vs CI environment pitfall: test_b3lyp fails locally without PYSCF_CONFIG_FILE=.github/workflows/pyscf_conf.py (PySCF then defaults to
the VWN3 RPA variant and the reference energy drifts −23.6/−6.98 kcal/mol,
identical on main) and passes with it set — the env var is part of the
CI job env, so it must be set for any local integration run.
Local OOM pitfall: running all 118 integration tests in one pytest
process trips the OOM killer at ~61%; the workflow's per-file invocations
are load-bearing locally too.
S1: Implement (numpy.testing swap + style cleanup of the touched file) (91f7dd4)
Activity
Anya497 commentedon Oct 7, 2026
Detailed Plan — #12 Fix ci in the PR #2
Integration branch:
agent_settings(stacked onmain).PR branch receiving the fix:
optimize_memory_usage(PR #2 head, based onmain).Problem: PR #2 CI (
build (3.12, ubuntu-latest), run 37587323506) fails at"Run unit tests" with 24 failures, all
AttributeError: module 'jax.numpy' has no attribute 'testing'fromtests/unit/test_kinetic_density_eq.py.Root cause: the equivalence test calls
jnp.testing.assert_allclose, butjax.numpyexposes notestingsubmodule (verified on the installed jax0.10.2:
hasattr(jnp, "testing")is False; the attribute does not exist onany jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclosehas the identical signature surface usedhere (
rtol,atol,err_msg) and accepts JAX arrays through__array__conversion — no reimplementation needed, no new dependency(numpy already ships with jax).
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in
tests/unit/test_kinetic_density_eq.py:import numpy as np, changejnp.testing.assert_allclose(tonp.testing.assert_allclose(.black,add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party
grad_dftimport, drop trailingwhitespace / missing final newline.
Tests:
pytest -vthe three unit files CI runs(
test_kinetic_density_eq.py,test_eigenproblem.py,test_loss.py) —0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:
black --checkandpylint -rn -sn --rcfile=.pylintrcon the touched file must be clean.Commit:
(#12-S1): use numpy.testing in kinetic density equivalence testplus a standalone
Closes #12, pushed to the PR #2 branch so CI re-runs.Acceptance criteria mapping
Design Notes
Correct Design: swap to
numpy.testingrather than patching around itor vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for
assert_allclose.Rejected: keeping
jnp.testingbehind a try/except import shim (hidesthe real API location), and
jnp.allclose+ plainassert(loses thediff diagnostics
err_msggives for free).Tolerance note: tests run without
jax_enable_x64(CI and local bothtruncate
float64→float32), and all 24 parametrizations pass atrtol=atol=1e-6; no tolerance change was needed.S1: Implement (numpy.testing swap + style cleanup of the touched file)
S1: Write tests (unit + integration pytest runs, 0 failures)
S1: Update Documentation (none required — test-only)
S1: Pre-Commit Check (black + pylint on the touched file)
S1: Quality checks (workflow parity, no duplicated helpers)
S1: Commit (Closes Fix ci in the PR #2 #12) + push to PR branch + CI green
(#12-S1): use numpy.testing in kinetic density equivalence test
Anya497 commentedon Oct 7, 2026
Detailed Plan — #12 Fix ci in the PR #2
Integration branch:
agent_settings(stacked onmain).PR branch receiving the fix:
optimize_memory_usage(PR #2 head, based onmain).Problem: PR #2 CI (
build (3.12, ubuntu-latest), run 37587323506) fails at"Run unit tests" with 24 failures, all
AttributeError: module 'jax.numpy' has no attribute 'testing'fromtests/unit/test_kinetic_density_eq.py.Root cause: the equivalence test calls
jnp.testing.assert_allclose, butjax.numpyexposes notestingsubmodule (verified on the installed jax0.10.2:
hasattr(jnp, "testing")is False; the attribute does not exist onany jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclosehas the identical signature surface usedhere (
rtol,atol,err_msg) and accepts JAX arrays through__array__conversion — no reimplementation needed, no new dependency(numpy already ships with jax).
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in
tests/unit/test_kinetic_density_eq.py:import numpy as np, changejnp.testing.assert_allclose(tonp.testing.assert_allclose(.black,add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party
grad_dftimport, drop trailingwhitespace / missing final newline.
Tests:
pytest -vthe three unit files CI runs(
test_kinetic_density_eq.py,test_eigenproblem.py,test_loss.py) —0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:
black --checkandpylint -rn -sn --rcfile=.pylintrcon the touched file must be clean.Commit:
(#12-S1): use numpy.testing in kinetic density equivalence testplus a standalone
Closes #12, pushed to the PR #2 branch so CI re-runs.Acceptance criteria mapping
Design Notes
Correct Design: swap to
numpy.testingrather than patching around itor vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for
assert_allclose.Rejected: keeping
jnp.testingbehind a try/except import shim (hidesthe real API location), and
jnp.allclose+ plainassert(loses thediff diagnostics
err_msggives for free).Tolerance note: tests run without
jax_enable_x64(CI and local bothtruncate
float64→float32), and all 24 parametrizations pass atrtol=atol=1e-6; no tolerance change was needed.Local vs CI environment pitfall:
test_b3lypfails locally withoutPYSCF_CONFIG_FILE=.github/workflows/pyscf_conf.py(PySCF then defaults tothe VWN3 RPA variant and the reference energy drifts −23.6/−6.98 kcal/mol,
identical on
main) and passes with it set — the env var is part of theCI job env, so it must be set for any local integration run.
Local OOM pitfall: running all 118 integration tests in one pytest
process trips the OOM killer at ~61%; the workflow's per-file invocations
are load-bearing locally too.
S1: Implement (numpy.testing swap + style cleanup of the touched file) (
91f7dd4)S1: Write tests (unit 29 passed; integration 118 passed per-file under
CI's PYSCF_CONFIG_FILE)
S1: Update Documentation (none required — test-only)
S1: Pre-Commit Check (black + pylint clean on the touched file)
S1: Quality checks (no duplicated helpers; b3lyp false alarm root-caused
to missing PYSCF_CONFIG_FILE locally, passes with CI env)
S1: Commit (Closes Fix ci in the PR #2 #12) + push to PR branch + CI green (pending
confirmation of the run)
(#12-S2): give PySCF an 8000 MB budget in the CI config
Anya497 commentedon Oct 7, 2026
Detailed Plan — #12 Fix ci in the PR #2
Integration branch:
agent_settings(stacked onmain).PR branch receiving the fix:
optimize_memory_usage(PR #2 head, based onmain).Problem: PR #2 CI (
build (3.12, ubuntu-latest), run 37587323506) fails at"Run unit tests" with 24 failures, all
AttributeError: module 'jax.numpy' has no attribute 'testing'fromtests/unit/test_kinetic_density_eq.py.Root cause: the equivalence test calls
jnp.testing.assert_allclose, butjax.numpyexposes notestingsubmodule (verified on the installed jax0.10.2:
hasattr(jnp, "testing")is False; the attribute does not exist onany jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclosehas the identical signature surface usedhere (
rtol,atol,err_msg) and accepts JAX arrays through__array__conversion — no reimplementation needed, no new dependency(numpy already ships with jax).
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in
tests/unit/test_kinetic_density_eq.py:import numpy as np, changejnp.testing.assert_allclose(tonp.testing.assert_allclose(.black,add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party
grad_dftimport, drop trailingwhitespace / missing final newline.
Tests:
pytest -vthe three unit files CI runs(
test_kinetic_density_eq.py,test_eigenproblem.py,test_loss.py) —0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:
black --checkandpylint -rn -sn --rcfile=.pylintrcon the touched file must be clean.Commit:
(#12-S1): use numpy.testing in kinetic density equivalence testplus a standalone
Closes #12, pushed to the PR #2 branch so CI re-runs.S2: Raise PySCF's memory budget for the CI interpreter
Found after S1: CI progressed past unit tests and failed on
tests/integration/solids/test_functional_implementations.py::test_pw92[sol1]with
ValueError: negative dimensions are not allowed.Diagnosis:
pyscf/pbc/df/fft_ao2mo.get_ericomputesremaining = mydf.max_memory - current_RSS(); PySCF's default budget(
pyscf/__config__.py: MAX_MEMORY = int(os.environ.get('PYSCF_MAX_MEMORY', 4000)))is 4000 MB, but the CI process (JAX + TensorFlow + PySCF in one interpreter)
already had RSS ≈ 4297 MB when the last solids test ran →
max_memory = -297.44→ negativeblksize→numpy.emptyraises.Reproduced locally with
PYSCF_MAX_MEMORY=100(same traceback,max_memory = -853.71). Not related to PR #2's code: a memory-budget envissue whose trigger depends on allocator variance (today's green run #8
landed under the 4000 MB line).
Code: add
MAX_MEMORY = 8000(with rationale comment) to.github/workflows/pyscf_conf.py— loaded via the job's existingPYSCF_CONFIG_FILE,exec'd after the env read, so it overrides both the4000 default and
PYSCF_MAX_MEMORY. One knob controls PySCF behavior for CIand for local CI-reproduction. 8000 > observed 4297 MB RSS; pyscf's
blksizemath then sizes its ERI buffer ≈ remaining budget (~3.7 GB), keeping total
RSS ≈ 8 GB inside the runner's 16 GB.
Tests: precedence verified
(
PYSCF_MAX_MEMORY=100+PYSCF_CONFIG_FILE→ 8000); the CI-failing filere-run with the config: 8 passed (CI had 1 failed, 7 passed). Other CI
files are unaffected by a budget increase and passed the S1 run.
Docs: module docstring in
pyscf_conf.pyrecords the local knob.Pre-commit check:
black --checkandpylint -rn -sn --rcfile=.pylintrcclean on the touched file.
Commit:
(#12-S2): give PySCF an 8000 MB budget in the CI config.Acceptance criteria mapping
Design Notes
Correct Design: swap to
numpy.testingrather than patching around itor vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for
assert_allclose.Rejected: keeping
jnp.testingbehind a try/except import shim (hidesthe real API location), and
jnp.allclose+ plainassert(loses thediff diagnostics
err_msggives for free).Tolerance note: tests run without
jax_enable_x64(CI and local bothtruncate
float64→float32), and all 24 parametrizations pass atrtol=atol=1e-6; no tolerance change was needed.Local vs CI environment pitfall:
test_b3lypfails locally withoutPYSCF_CONFIG_FILE=.github/workflows/pyscf_conf.py(PySCF then defaults tothe VWN3 RPA variant and the reference energy drifts −23.6/−6.98 kcal/mol,
identical on
main) and passes with it set — the env var is part of theCI job env, so it must be set for any local integration run.
Local OOM pitfall: running all 118 integration tests in one pytest
process trips the OOM killer at ~61%; the workflow's per-file invocations
are load-bearing locally too.
S1: Implement (numpy.testing swap + style cleanup of the touched file) (
91f7dd4)S1: Write tests (unit 29 passed; integration 118 passed per-file under
CI's PYSCF_CONFIG_FILE)
S1: Update Documentation (none required — test-only)
S1: Pre-Commit Check (black + pylint clean on the touched file)
S1: Quality checks (no duplicated helpers; b3lyp false alarm root-caused
to missing PYSCF_CONFIG_FILE locally, passes with CI env)
S1: Commit (Closes Fix ci in the PR #2 #12) + push to PR branch (
91f7dd4)S2: Implement (MAX_MEMORY=8000 in
.github/workflows/pyscf_conf.py)S2: Write tests (precedence check; CI-failing file 8 passed with config)
S2: Update Documentation (module docstring in pyscf_conf.py)
S2: Pre-Commit Check (black + pylint clean on pyscf_conf.py)
S2: Quality checks (single PySCF knob; no code-path changes)
S2: Commit + push + CI green (pending)
Anya497 commentedon Oct 7, 2026
Detailed Plan — #12 Fix ci in the PR #2
Integration branch:
agent_settings(stacked onmain).PR branch receiving the fix:
optimize_memory_usage(PR #2 head, based onmain).Problem: PR #2 CI (
build (3.12, ubuntu-latest), run 37587323506) fails at"Run unit tests" with 24 failures, all
AttributeError: module 'jax.numpy' has no attribute 'testing'fromtests/unit/test_kinetic_density_eq.py.Root cause: the equivalence test calls
jnp.testing.assert_allclose, butjax.numpyexposes notestingsubmodule (verified on the installed jax0.10.2:
hasattr(jnp, "testing")is False; the attribute does not exist onany jax in the supported range either). The call can never resolve, so every
parametrization errors before comparing anything.
Reuse analysis
numpy.testing.assert_allclosehas the identical signature surface usedhere (
rtol,atol,err_msg) and accepts JAX arrays through__array__conversion — no reimplementation needed, no new dependency(numpy already ships with jax).
handling) is unaffected: the failure is a single API-name error, not a
numerical one.
Subtasks
S1: Fix the assertion API and make the touched file style-clean
Code: in
tests/unit/test_kinetic_density_eq.py:import numpy as np, changejnp.testing.assert_allclose(tonp.testing.assert_allclose(.black,add the module/function docstrings pylint reports, reorder imports so
third-party precedes the first-party
grad_dftimport, drop trailingwhitespace / missing final newline.
Tests:
pytest -vthe three unit files CI runs(
test_kinetic_density_eq.py,test_eigenproblem.py,test_loss.py) —0 failures; plus the eight integration files from the workflow (they never
ran in CI because the unit step aborted first).
Docs: none — test-only change, no user-facing surface.
Pre-commit check:
black --checkandpylint -rn -sn --rcfile=.pylintrcon the touched file must be clean.Commit:
(#12-S1): use numpy.testing in kinetic density equivalence testplus a standalone
Closes #12, pushed to the PR #2 branch so CI re-runs.S2: Raise PySCF's memory budget for the CI interpreter
Found after S1: CI progressed past unit tests and failed on
tests/integration/solids/test_functional_implementations.py::test_pw92[sol1]with
ValueError: negative dimensions are not allowed.Diagnosis:
pyscf/pbc/df/fft_ao2mo.get_ericomputesremaining = mydf.max_memory - current_RSS(); PySCF's default budget(
pyscf/__config__.py: MAX_MEMORY = int(os.environ.get('PYSCF_MAX_MEMORY', 4000)))is 4000 MB, but the CI process (JAX + TensorFlow + PySCF in one interpreter)
already had RSS ≈ 4297 MB when the last solids test ran →
max_memory = -297.44→ negativeblksize→numpy.emptyraises.Reproduced locally with
PYSCF_MAX_MEMORY=100(same traceback,max_memory = -853.71). Not related to PR #2's code: a memory-budget envissue whose trigger depends on allocator variance (today's green run #8
landed under the 4000 MB line).
Code: add
MAX_MEMORY = 8000(with rationale comment) to.github/workflows/pyscf_conf.py— loaded via the job's existingPYSCF_CONFIG_FILE,exec'd after the env read, so it overrides both the4000 default and
PYSCF_MAX_MEMORY. One knob controls PySCF behavior for CIand for local CI-reproduction. 8000 > observed 4297 MB RSS; pyscf's
blksizemath then sizes its ERI buffer ≈ remaining budget (~3.7 GB), keeping total
RSS ≈ 8 GB inside the runner's 16 GB.
Tests: precedence verified
(
PYSCF_MAX_MEMORY=100+PYSCF_CONFIG_FILE→ 8000); the CI-failing filere-run with the config: 8 passed (CI had 1 failed, 7 passed). Other CI
files are unaffected by a budget increase and passed the S1 run.
Docs: module docstring in
pyscf_conf.pyrecords the local knob.Pre-commit check:
black --checkandpylint -rn -sn --rcfile=.pylintrcclean on the touched file.
Commit:
(#12-S2): give PySCF an 8000 MB budget in the CI config.Acceptance criteria mapping
Design Notes
Correct Design: swap to
numpy.testingrather than patching around itor vendoring an assert helper — numpy is already a hard dependency and the
module is the canonical home for
assert_allclose.Rejected: keeping
jnp.testingbehind a try/except import shim (hidesthe real API location), and
jnp.allclose+ plainassert(loses thediff diagnostics
err_msggives for free).Tolerance note: tests run without
jax_enable_x64(CI and local bothtruncate
float64→float32), and all 24 parametrizations pass atrtol=atol=1e-6; no tolerance change was needed.Local vs CI environment pitfall:
test_b3lypfails locally withoutPYSCF_CONFIG_FILE=.github/workflows/pyscf_conf.py(PySCF then defaults tothe VWN3 RPA variant and the reference energy drifts −23.6/−6.98 kcal/mol,
identical on
main) and passes with it set — the env var is part of theCI job env, so it must be set for any local integration run.
Local OOM pitfall: running all 118 integration tests in one pytest
process trips the OOM killer at ~61%; the workflow's per-file invocations
are load-bearing locally too.
S1: Implement (numpy.testing swap + style cleanup of the touched file) (
91f7dd4)S1: Write tests (unit 29 passed; integration 118 passed per-file under
CI's PYSCF_CONFIG_FILE)
S1: Update Documentation (none required — test-only)
S1: Pre-Commit Check (black + pylint clean on the touched file)
S1: Quality checks (no duplicated helpers; b3lyp false alarm root-caused
to missing PYSCF_CONFIG_FILE locally, passes with CI env)
S1: Commit (Closes Fix ci in the PR #2 #12) + push to PR branch (
91f7dd4)S2: Implement (MAX_MEMORY=8000 in
.github/workflows/pyscf_conf.py)S2: Write tests (precedence check; CI-failing file 8 passed with config)
S2: Update Documentation (module docstring in pyscf_conf.py)
S2: Pre-Commit Check (black + pylint clean on pyscf_conf.py)
S2: Quality checks (single PySCF knob; no code-path changes)
S2: Commit (
7cbd430) + push + CI green (run 37603596959, pass 14m41s)