Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 8, 2025

This PR fixes a critical issue where dpgen autotest run would fail with RuntimeError: cannot find upload file when using VASP as the DFT calculator.

Problem

When running dpgen autotest run relax.json machine.json with VASP configuration, users encountered:

RuntimeError: cannot find upload file /home/user/project/autotest/dft INCAR_

This error occurred because:

  1. VASP's forward_common_files() method returned ["INCAR", "POTCAR"]
  2. dpdispatcher tried to upload these "common" files from the work_path directory
  3. However, VASP actually creates these files per-task in subdirectories (e.g., confs/ZrO2-m/relaxation/) and symlinks them to task directories
  4. The files don't exist in the work_path, causing the upload to fail

Solution

Modified VASP.forward_common_files() to return an empty list [] instead of ["INCAR", "POTCAR"]. This change:

  • Prevents dpdispatcher from trying to upload non-existent common files
  • Aligns VASP behavior with ABACUS, which also returns [] for similar reasons
  • Maintains all existing functionality since INCAR/POTCAR files are still created per-task via make_input_file() and make_potential_files() methods
  • Preserves the forward_files() method which correctly returns task-specific files

Testing

  • All existing tests pass (67/67 tests in auto_test module)
  • Added comprehensive test cases to verify the fix works for all property types
  • Verified that forward_files() still returns correct task-specific files: ["INCAR", "POSCAR", "KPOINTS", "POTCAR"]

Fixes #1139.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] [BUG] _dpgen autotest run error_<work_path> fix: return empty list for VASP forward_common_files to prevent upload errors Sep 8, 2025
@Copilot Copilot AI requested a review from njzjz September 8, 2025 06:03
Copilot finished work on behalf of njzjz September 8, 2025 06:03
@njzjz
Copy link
Member

njzjz commented Sep 8, 2025

pre-commit.ci autofix

Copy link

codecov bot commented Sep 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.84%. Comparing base (31043b0) to head (34ce655).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #1811      +/-   ##
==========================================
+ Coverage   49.80%   49.84%   +0.03%     
==========================================
  Files          83       83              
  Lines       14904    14899       -5     
==========================================
+ Hits         7423     7426       +3     
+ Misses       7481     7473       -8     

☔ View full report in Codecov by Sentry.
📢 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.

[BUG] _dpgen autotest run error_<work_path>
2 participants