Skip to content

feat(confsearch): TUI entry (P5) - #67

Merged
hydrogen1222 merged 2 commits into
mainfrom
confsearch/p5-tui
Oct 26, 2026
Merged

hydrogen1222 merged 2 commits into
mainfrom
confsearch/p5-tui

Conversation

@hydrogen1222

@hydrogen1222 hydrogen1222 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Tracking: #61
Implements spec revision 4, phase P5.

What this does

Adds the TUI entry for the configuration search:

  • main screen: a "Configuration Search (CONFSEARCH)" entry, and the template
    screen plus mliport template confsearch can generate the INCAR template.
  • configuration screen: both start modes (Structure File + 0-based Adsorbate
    Indices for mode A; Slab File + Molecule File + Number of Placed Starts for
    mode B), cycles, MD-mobile set, high/low temperature, hold/cool durations and
    exported top-K, plus a note that the ranking reports the lowest minimum found
    and that a one-sided slab needs a dipole correction in the DFT single point.
  • validation: mixing mode A and B, a partial mode B, missing paths, non-integer
    counts, non-finite/negative temperatures and low > high all fail with a
    notification instead of launching a bad job.
  • run screen: the confsearch branch forwards every confsearch option and the
    mode A/B structural fields to the shared build_mliport_command helper,
    so the TUI and mliport queue submit cannot drift.
  • capability matrix: confsearch_user_starts and confsearch_placement are now
    yes for the TUI; resume/extend/merge/export stay no with notes.
  • docs (EN + ZH): a sentence on the TUI entry and on extend/merge being
    commands.

What it does NOT do yet

  • The TUI cannot resume, extend, merge or export a confsearch run (those are
    commands; the capability matrix records it).
  • No queue/TUI progress bar specific to confsearch: it reuses the generic
    background-job screen and run.log.
  • The real-model validation campaign (section 13.3) still has to be run by the
    owner on a GPU; it is not part of CI.

Tests run and results

CUDA_VISIBLE_DEVICES="" .venv-dev/bin/python -m pytest -q
CUDA_VISIBLE_DEVICES="" .venv-dev/bin/python -m pytest tests/mliport/mliport/confsearch tests/mliport/mliport/test_confsearch_validation_suite.py -q
.venv-dev/bin/ruff check mliport/mliport tests scripts validation/science/scripts
.venv-dev/bin/ruff format --check mliport/mliport tests scripts validation/science/scripts
.venv-dev/bin/python scripts/check_repository_hygiene.py
  • 1602 passed, 33 skipped; tests/mliport/mliport/test_tui.py grew to 44
    tests, including four new ones: the main-screen entry, the confsearch form
    widgets, the mode A and mode B background commands, and the partial-mode-B
    rejection.
  • confsearch --help remains in the documented CLI smoke list.

Deviations from spec

  • The TUI exposes a curated subset of the CS_* keys (the ones a user needs to
    start a run); the rest stay CLI/INCAR/API-only. The capability matrix says
    which interface can express what, per section 12.4.
  • Resuming is deliberately not offered in the TUI: the run directory and
    checkpoint identity checks are easier to get wrong behind a form, and the
    spec's CLI grammar has resume as a command.
  • Tests not written red-first: the TUI form, the save/validate path and the
    run-screen branch were implemented first and then covered by the four tests in
    the same commit; the mode-A/mode-B dispatch bug they exposed (the app's
    default cs_n_starts making mode A look like mode B) was fixed against the
    failing test.

Revision 5 follow-up (review of this PR)

Re-checked after #63-#66 changed the option set:

  • The TUI confsearch form exposes only mode A/B starts, cycles, the MD-mobile
    set, temperatures, hold/cool durations and top-K, none of which changed
    semantics in revision 5. Anchored placement (whose partner set changed in
    §5.2) is not exposed in the TUI, so there is no form text to correct.
  • The rev 5 live, append-only run.log makes the run screen's log tailing
    strictly better (progress appears while the run is going, and a resume
    appends).
  • The TUI test now also pins the wording the review cares about: the caveat note
    keeps "never a global minimum" and the dipole-correction advice, and the mode
    note keeps the 0-based ASE convention and says mode B is placement rather than
    user starts.
  • The whole stack was rebased onto the merged main after refactor(runners): shared safety helpers for MD and confsearch (P0) #62, so this PR's
    diff is the TUI change only.

Full suite on CPU (rebased stack): 1632 passed, 33 skipped; lint/format and
the repository hygiene check clean; CI green.


Revision 6 follow-up (second review of this PR)

The second review asked for no changes here: the TUI does not expose anchored
placement, and the pinned wording (0-based ASE convention, mode B is placement,
"never a global minimum", dipole-correction advice) is right. The branch was
rebased onto the revision-6 stack so its diff stays the TUI change only.

Full suite on CPU: 1639 passed, 33 skipped; lint/format/hygiene clean; CI
green.

Tracking: #61 (spec revision 4, phase P5)
Part of the MD-based configuration search feature.

What was missing: the TUI could not start a confsearch run at all (the
capability matrix recorded `no` for every confsearch TUI column).

What this adds:
- main screen: a "Configuration Search (CONFSEARCH)" entry, and the template
  screen plus `mliport template confsearch` can now generate the INCAR template.
- configuration screen: a confsearch form with both start modes (Structure File
  + 0-based Adsorbate Indices for mode A; Slab File + Molecule File + Number of
  Placed Starts for mode B), cycles, MD-mobile set, high/low temperature,
  hold/cool durations and exported top-K, plus a note that the ranking reports
  the lowest minimum found (never a global minimum) and that a one-sided slab
  needs a dipole correction in the DFT single point.
- validation in _save_and_run: mixing mode A and B, a partial mode B, missing
  paths, non-integer counts, non-finite/negative temperatures and low > high all
  fail with a notification instead of launching a bad job; mode B names the slab
  as the structural input so the shared guard still applies.
- run screen: the confsearch branch forwards every confsearch option and the
  mode A/B structural fields to the *shared* `build_mliport_command` helper, so
  the TUI and `mliport queue submit` cannot drift.
- capability matrix: confsearch_user_starts and confsearch_placement are now
  `yes` for the TUI; resume/extend/merge/export stay `no` with notes (resuming
  is a command).
- docs (EN + ZH): a sentence on the TUI entry and on extend/merge being
  commands, structure unchanged.

Tests: four TUI tests (the main-screen entry, the confsearch form widgets, the
mode A and mode B background commands, and the partial-mode-B rejection).
Full suite on CPU: 1602 passed, 33 skipped.

DATA IMPACT: no scientific record invalidated. New entry point only.

@hydrogen1222 hydrogen1222 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review (spec rev 5) — P5: OK after the stack is fixed

The TUI branch uses the shared build_mliport_command, validates mode A/B mixing, and the capability matrix is honest about resume/extend/merge/export being command-only. No changes requested here; re-check after #63–#66 change the option set (e.g. anchor partner semantics) so the TUI form text stays accurate.

🤖 Generated with Claude Code


Generated by Claude Code

@hydrogen1222
hydrogen1222 force-pushed the confsearch/p4-queue-p5-validation branch from 6fe4248 to 079d957 Compare October 25, 2026 16:32
Tracking: #61 (spec revision 5, PR #67 review)

The #67 review asked for a re-check after #63-#66 changed the option set.  The
TUI form exposes only mode A/B starts, cycles, the MD-mobile set, temperatures,
hold/cool durations and top-K, none of which changed semantics in revision 5;
anchored placement (whose partner set did change, section 5.2) is not exposed in
the TUI, and the live append-only `run.log` from section 11.1 makes the run
screen's progress tailing strictly better.

The existing TUI test now also pins the wording the review cares about: the
caveat note keeps "never a global minimum" and the dipole-correction advice, and
the mode note keeps the 0-based ASE convention and states that mode B is
placement rather than user starts.

Full suite on CPU: 1632 passed, 33 skipped; ruff check/format and the repository
hygiene check are clean.

DATA IMPACT: no scientific record invalidated. Test-only change.
hydrogen1222 added a commit that referenced this pull request Oct 25, 2026
Tracking: #61 (spec revision 5, PR #67 review)

The #67 review asked for a re-check after #63-#66 changed the option set.  The
TUI form exposes only mode A/B starts, cycles, the MD-mobile set, temperatures,
hold/cool durations and top-K, none of which changed semantics in revision 5;
anchored placement (whose partner set did change, section 5.2) is not exposed in
the TUI, and the live append-only `run.log` from section 11.1 makes the run
screen's progress tailing strictly better.

The existing TUI test now also pins the wording the review cares about: the
caveat note keeps "never a global minimum" and the dipole-correction advice, and
the mode note keeps the 0-based ASE convention and states that mode B is
placement rather than user starts.

Full suite on CPU: 1632 passed, 33 skipped; ruff check/format and the repository
hygiene check are clean.

DATA IMPACT: no scientific record invalidated. Test-only change.
@hydrogen1222
hydrogen1222 force-pushed the confsearch/p4-queue-p5-validation branch from 079d957 to 8811715 Compare October 25, 2026 16:45
hydrogen1222 added a commit that referenced this pull request Oct 25, 2026
Tracking: #61 (spec revision 5, PR #67 review)

The #67 review asked for a re-check after #63-#66 changed the option set.  The
TUI form exposes only mode A/B starts, cycles, the MD-mobile set, temperatures,
hold/cool durations and top-K, none of which changed semantics in revision 5;
anchored placement (whose partner set did change, section 5.2) is not exposed in
the TUI, and the live append-only `run.log` from section 11.1 makes the run
screen's progress tailing strictly better.

The existing TUI test now also pins the wording the review cares about: the
caveat note keeps "never a global minimum" and the dipole-correction advice, and
the mode note keeps the 0-based ASE convention and states that mode B is
placement rather than user starts.

Full suite on CPU: 1632 passed, 33 skipped; ruff check/format and the repository
hygiene check are clean.

DATA IMPACT: no scientific record invalidated. Test-only change.

@hydrogen1222 hydrogen1222 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Second review (spec rev 6) — P5: no changes

Re-checked after the rev 5 changes; the TUI does not expose anchored placement and the pinned wording is right. Nothing further here.

🤖 Generated with Claude Code


Generated by Claude Code

@hydrogen1222
hydrogen1222 force-pushed the confsearch/p4-queue-p5-validation branch from 8811715 to eb766e1 Compare October 26, 2026 03:13
hydrogen1222 added a commit that referenced this pull request Oct 26, 2026
Tracking: #61 (spec revision 5, PR #67 review)

The #67 review asked for a re-check after #63-#66 changed the option set.  The
TUI form exposes only mode A/B starts, cycles, the MD-mobile set, temperatures,
hold/cool durations and top-K, none of which changed semantics in revision 5;
anchored placement (whose partner set did change, section 5.2) is not exposed in
the TUI, and the live append-only `run.log` from section 11.1 makes the run
screen's progress tailing strictly better.

The existing TUI test now also pins the wording the review cares about: the
caveat note keeps "never a global minimum" and the dipole-correction advice, and
the mode note keeps the 0-based ASE convention and states that mode B is
placement rather than user starts.

Full suite on CPU: 1632 passed, 33 skipped; ruff check/format and the repository
hygiene check are clean.

DATA IMPACT: no scientific record invalidated. Test-only change.
@hydrogen1222
hydrogen1222 force-pushed the confsearch/p4-queue-p5-validation branch from eb766e1 to 54ba7f7 Compare October 26, 2026 03:18
Base automatically changed from confsearch/p4-queue-p5-validation to main October 26, 2026 04:17
@hydrogen1222
hydrogen1222 marked this pull request as ready for review October 26, 2026 04:17
@hydrogen1222
hydrogen1222 merged commit 8f09042 into main Oct 26, 2026
13 checks passed
@hydrogen1222
hydrogen1222 deleted the confsearch/p5-tui branch October 26, 2026 04:17
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