Describe the Code Quality Issue
Problem
While working on the integrate-test tooling in tests/integrate/, we hit
several maintenance pain points:
-
A 1000+-line monolithic collector. tests/integrate/tools/catch_properties.sh
collects every kind of result line (energies, forces, stresses, DOS,
matrices, cubes, ML, DeePKS, TDDFT, ...) into result.out in a single
file. Finding where a given key is produced is slow, and adding a new
kind of check means editing an ever-growing file whose output-order
constraints are only implicit.
-
Duplicated helpers. catch_deepks_properties.sh re-defines helpers
(sum_file, get_input_key_value, compare-script path) that also exist
in catch_properties.sh, so the two copies can drift apart silently.
-
Hard-coded relative paths. Scripts reference helpers through
../../integrate/tools/... relative to the test-case working
directory, which breaks whenever the collector is invoked with a
different CWD and makes the scripts fragile to relocation.
-
Dead code. E.g. the compare-wfc subcommand of cube_tool.py has
no caller, and the collector contains unreachable branches.
-
Awkward executable selection for local runs. Pointing the tests at
a local ABACUS build requires either exporting ABACUS_EXE in every
new shell or editing tracked files (Autotest.sh, general_info),
which risks committing a machine-specific absolute path.
-
No documentation of the validation workflow. How result.ref /
result.out comparison works (thresholds, per-case threshold files,
the information-only totaltimeref line) is not written down anywhere;
the directory name tools also does not convey that these scripts are
the validation toolkit.
Proposal
-
Split the collector into one module per result family
(props_basic.sh, props_mat.sh, props_cube.sh, props_ml.sh,
props_tddft.sh, props_deepks.sh) plus a shared props_common.sh,
each exposing run_<category>_props() hooks; catch_properties.sh
becomes a thin orchestrator that calls the hooks in the original order.
-
Rename tests/integrate/tools to tests/integrate/validation_tools
and resolve helper paths from the script's own location.
-
Support an untracked, gitignored integrate/general_info.local as a
local executable override (priority: -a flag > ABACUS_EXE >
local file > PATH), on top of the existing ABACUS_EXE support.
-
Document the validation workflow (three entry points: whole category,
single case, collector-only) in tests/README.
-
Remove the dead code.
Constraints
-
The collected output must not change: result.out content and exit
codes stay byte-for-byte identical for all existing cases (verified by
running the old and new collectors side by side; only totaltimeref,
the wall-time line, differs by design).
-
No INPUT parameter behavior is involved, and CI (which only invokes
Autotest.sh) keeps working unchanged.
Additional Context
No response
Task list for Issue attackers (only for developers)
Describe the Code Quality Issue
Problem
While working on the integrate-test tooling in
tests/integrate/, we hitseveral maintenance pain points:
A 1000+-line monolithic collector.
tests/integrate/tools/catch_properties.shcollects every kind of result line (energies, forces, stresses, DOS,
matrices, cubes, ML, DeePKS, TDDFT, ...) into
result.outin a singlefile. Finding where a given key is produced is slow, and adding a new
kind of check means editing an ever-growing file whose output-order
constraints are only implicit.
Duplicated helpers.
catch_deepks_properties.shre-defines helpers(
sum_file,get_input_key_value, compare-script path) that also existin
catch_properties.sh, so the two copies can drift apart silently.Hard-coded relative paths. Scripts reference helpers through
../../integrate/tools/...relative to the test-case workingdirectory, which breaks whenever the collector is invoked with a
different CWD and makes the scripts fragile to relocation.
Dead code. E.g. the
compare-wfcsubcommand ofcube_tool.pyhasno caller, and the collector contains unreachable branches.
Awkward executable selection for local runs. Pointing the tests at
a local ABACUS build requires either exporting
ABACUS_EXEin everynew shell or editing tracked files (
Autotest.sh,general_info),which risks committing a machine-specific absolute path.
No documentation of the validation workflow. How
result.ref/result.outcomparison works (thresholds, per-casethresholdfiles,the information-only
totaltimerefline) is not written down anywhere;the directory name
toolsalso does not convey that these scripts arethe validation toolkit.
Proposal
Split the collector into one module per result family
(
props_basic.sh,props_mat.sh,props_cube.sh,props_ml.sh,props_tddft.sh,props_deepks.sh) plus a sharedprops_common.sh,each exposing
run_<category>_props()hooks;catch_properties.shbecomes a thin orchestrator that calls the hooks in the original order.
Rename
tests/integrate/toolstotests/integrate/validation_toolsand resolve helper paths from the script's own location.
Support an untracked, gitignored
integrate/general_info.localas alocal executable override (priority:
-aflag >ABACUS_EXE>local file > PATH), on top of the existing
ABACUS_EXEsupport.Document the validation workflow (three entry points: whole category,
single case, collector-only) in
tests/README.Remove the dead code.
Constraints
The collected output must not change:
result.outcontent and exitcodes stay byte-for-byte identical for all existing cases (verified by
running the old and new collectors side by side; only
totaltimeref,the wall-time line, differs by design).
No INPUT parameter behavior is involved, and CI (which only invokes
Autotest.sh) keeps working unchanged.Additional Context
No response
Task list for Issue attackers (only for developers)