Skip to content

Fix ci in the PR #2 #12

Closed
Closed

Description

@Anya497

Fix ci in the PR #2

Activity

  1. added
    taskA single task: one feature branch, one detailed plan, one integration
    on Oct 7, 2026
  2. Anya497 commented on Oct 7, 2026

    @Anya497
    OwnerAuthor

    Detailed Plan — #12 Fix ci in the PR #2

    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:

    1. Add import numpy as np, change jnp.testing.assert_allclose( to
      np.testing.assert_allclose(.
    2. 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.

    Acceptance criteria mapping

    Criterion Where
    PR #2 CI green S1 fixes the only failing step; push re-triggers CI
    Unit tests 0 failures locally S1: pytest over the three CI unit files
    Style gate on touched files S1: black + pylint clean on the test file
    Repo-wide style debt out of scope, already tracked by #7

    Design Notes

    • 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)

    • 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

  3. added a commit that references this issue on Oct 7, 2026
  4. Anya497 commented on Oct 7, 2026

    @Anya497
    OwnerAuthor

    Detailed Plan — #12 Fix ci in the PR #2

    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:

    1. Add import numpy as np, change jnp.testing.assert_allclose( to
      np.testing.assert_allclose(.
    2. 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.

    Acceptance criteria mapping

    Criterion Where
    PR #2 CI green S1 fixes the only failing step; push re-triggers CI
    Unit tests 0 failures locally S1: pytest over the three CI unit files
    Style gate on touched files S1: black + pylint clean on the test file
    Repo-wide style debt out of scope, already tracked by #7

    Design Notes

    • 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)

    • 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)

  5. added a commit that references this issue on Oct 7, 2026
  6. Anya497 commented on Oct 7, 2026

    @Anya497
    OwnerAuthor

    Detailed Plan — #12 Fix ci in the PR #2

    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:

    1. Add import numpy as np, change jnp.testing.assert_allclose( to
      np.testing.assert_allclose(.
    2. 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.

    Acceptance criteria mapping

    Criterion Where
    PR #2 CI green S1 fixes the failing unit step; S2 fixes the failing integration step
    Unit tests 0 failures locally S1: pytest over the three CI unit files
    Integration tests 0 failures locally S1: all eight files; S2: re-ran the CI-failing file with the CI config
    Style gate on touched files S1/S2: black + pylint clean on both touched files
    Repo-wide style debt out of scope, already tracked by #7

    Design Notes

    • 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)

    • 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)

  7. Anya497 commented on Oct 7, 2026

    @Anya497
    OwnerAuthor

    Detailed Plan — #12 Fix ci in the PR #2

    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:

    1. Add import numpy as np, change jnp.testing.assert_allclose( to
      np.testing.assert_allclose(.
    2. 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.

    Acceptance criteria mapping

    Criterion Where
    PR #2 CI green S1 fixes the failing unit step; S2 fixes the failing integration step
    Unit tests 0 failures locally S1: pytest over the three CI unit files
    Integration tests 0 failures locally S1: all eight files; S2: re-ran the CI-failing file with the CI config
    Style gate on touched files S1/S2: black + pylint clean on both touched files
    Repo-wide style debt out of scope, already tracked by #7

    Design Notes

    • 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)

    • 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)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskA single task: one feature branch, one detailed plan, one integration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions