Skip to content

🐛 Process dump: gate node_outputs on repository content - #7525

Open
elinscott wants to merge 2 commits into
aiidateam:mainfrom
elinscott:fix/dump-arraydata-outputs
Open

🐛 Process dump: gate node_outputs on repository content#7525
elinscott wants to merge 2 commits into
aiidateam:mainfrom
elinscott:fix/dump-arraydata-outputs

Conversation

@elinscott

@elinscott elinscott commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #7523

Problem

NodeRepoIoDumper._dump_calculation_io decided whether to create node_outputs/ by asking whether any output of the calculation was a SinglefileData or a FolderData, and then dumped the full, unfiltered list of outputs into it. This gave differening opionions on what should be dumped, giving strange behaviour e.g. an output node's fate depended on its siblings:

  • a calculation returning an ArrayData next to a SinglefileData got both written
  • a calculation returning that same ArrayData on its own got nothing!

The same applies to every other repository-backed type the isinstance check does not name (BandsData, TrajectoryData and XyData) all of which store .npy payloads as ArrayData subclasses, and a KpointsData holding an explicit k-point list rather than a mesh.

Changes

The gate now asks each output whether it has repository content

any(link.node.base.repository.list_object_names() for link in output_links_filtered)

which is the same per-node question _dump_calculation_io_files already answers a few lines further down when it decides what to write.

The directory-creation check and the writing loop now agree by construction, so the type list cannot drift out of date again. The check's real purpose is preserved: calculations whose outputs live entirely in the database (Dict, Int, StructureData, RemoteData) have empty repositories, so they still leave no empty node_outputs/ behind.

Of course, this means that dumps of array-heavy profiles grow, in some cases substantially --- but this is intended behaviour and not a new cost. (A non-representative example: one of my workflow dumps grew by 3% due to this change.)

Testing

New tests/tools/dumping/test_process.py asserts:

  • an array-only calculation dumps node_outputs/arraydata/default.npy (fails before this change);
  • an array plus a file-like sibling dumps both (passes before this change — this is the case that masked the bug);
  • a calculation returning only Dict and Int creates no node_outputs/ directory (passes before this change — this pins the check's original purpose).

The existing dumping tests are unaffected.

Notes

  • This increases the chances of collision when using flat mode
  • Unrelated but observed when writing this PR: tests/tools/dumping/integration_tests.py is not picked up by pytest, so its 26 tests have never run in CI. They do pass when invoked explicitly, both before and after this change.

`node_outputs/` was created only when a calculation had a
`SinglefileData` or `FolderData` output, but the full, unfiltered list
of output nodes was then dumped into it. An `ArrayData` output was
therefore written when a file-like output happened to sit beside it and
dropped when it was the only output, so whether a node reached disk
depended on its siblings rather than on itself.

Gate the directory on whether an output actually carries repository
content, the same per-node decision `_dump_calculation_io_files` already
makes when it writes them. Calculations returning only database-backed
nodes still produce no empty `node_outputs/`.

Add regression tests for an array-only calculation, an array with a
file-like sibling, and a database-only calculation.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The process dumper now creates node_outputs/ when non-retrieved outputs contain repository objects. Regression tests cover ArrayData outputs alone, with SinglefileData, and database-only outputs.

Changes

Process output dumping

Layer / File(s) Summary
Repository-based output detection and regression coverage
src/aiida/tools/_dumping/executors/process.py, tests/tools/dumping/test_process.py
Output directory creation checks repository contents. Tests validate ArrayData dumping and suppress empty directories for database-only outputs.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code and tests satisfy issue #7523 by dumping repository-backed outputs independently and avoiding empty output directories.
Out of Scope Changes check ✅ Passed All code and test changes directly support issue #7523 and the stated process-dumping objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly identifies the process dump fix and the repository-content gate for the node_outputs directory.
Description check ✅ Passed The description directly explains the dumping bug, the implementation change, and the regression tests.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.67%. Comparing base (8a2747e) to head (ddb575f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7525      +/-   ##
==========================================
+ Coverage   80.67%   80.67%   +0.01%     
==========================================
  Files         581      581              
  Lines       46998    46998              
==========================================
+ Hits        37909    37913       +4     
+ Misses       9089     9085       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

When dumping, ArrayData outputs are omitted depending on their siblings

1 participant