Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM, no concerns found. I reviewed all 30 changed files and traced the affected verifier and export consumers. The changes keep grading logic unchanged, isolate configured verification attempts, and parse OpenCode artifacts before temporary-directory cleanup.
I did not execute tests or rollouts in this read-only review.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
32ccdff to
88c885e
Compare
91f8acf to
a42e4e5
Compare
a1c43c6 to
1849780
Compare
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
No eligible findings in this follow-up.
I checked the shared verification-log helper, its runtime contracts, and representative SWE callers. I also checked the affected tests and temporary-file lifetimes in SWE-bench and OpenCode. SWE-bench reads test output before cleanup, and OpenCode finishes file-dependent parsing before removing its temporary folder. SWE-bench Pro’s attempt timeout exits before log retention runs.
Review 5928704286 had no findings to recheck. Its reviewed tree is unavailable, so I could not establish the exact changes since that review. The supplied diff compares against the PR base, not the previously reviewed head. This approval is limited to the follow-up scope, not a fresh whole-PR review.
I did not execute tests or rollouts.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
1790002 to
521ab36
Compare
15fac36 to
7ac1b58
Compare
b1f50bd to
80b92b6
Compare
ca6870b to
e1eafc6
Compare
6107b0b to
aaf9e4a
Compare
Six SWE-style resources servers wrote a verification log on every /verify call into a logs/ folder next to their own app.py: scale_swe, swe_next, r2e_gym, swe_gym, denovo_swe and swebench_pro. In training, that folder is inside the Gym checkout mounted from a shared filesystem, so every verification created a folder and files there, and nothing removed them. swebench_pro also added one folder per session. Each of these servers now takes verification_log_dir, the setting that swe_rebench and the swemer servers already had. It defaults to null, so no logs are written. When it is set, logs go to <verification_log_dir>/instance-<id>/<random>/attempt-<n>. The path is built by one helper, resources_servers/swebench/verification_logs.py, which the servers that already had the setting now use too. opencode_sandboxed_agent wrote each session's OpenCode export into a results/ folder next to its app.py when artifacts_dir was unset. It now uses a temporary folder in that case and removes it once the export and database snapshot are parsed, and opencode_results_fpath is empty. Signed-off-by: Ananth Subramaniam <[email protected]>
A relative path resolves against the server's working directory, which is its own source folder, so it would bring back writes into the checkout. Signed-off-by: Ananth Subramaniam <[email protected]>
The swebench resources server, which grades SWE-bench Multilingual, ran the SWE-bench harness with its default log folder. That folder is relative to the working directory, which is the server's own source folder. So every verify created a logs/run_evaluation/<run_id> tree in the checkout, searched it and deleted it, and an interrupted verify left the tree behind. run_instance now takes the log folder as an argument. The server gives each verify a new temporary folder and removes it in a finally block. To keep a copy, set verification_log_dir, as for the other SWE servers. clear_swebench_debug_logs has no effect now. It is still accepted so existing configs load, and it logs a warning when it is set to false without verification_log_dir. analyze_golden_patch_logs.py takes the log folder as an argument instead of the old path. Signed-off-by: Ananth Subramaniam <[email protected]>
The failure-only grading tests run the real run_instance. They now pass log_root and keep the working directory empty, and a new test checks that the test output and report land under log_root and nothing is written to the working directory. Signed-off-by: Ananth Subramaniam <[email protected]>
The SWE resources servers now take a per-server debug_dir in place of verification_log_dir, and build each verification's log folder with debug_folder from nemo_gym.core.runtime_files. When the server's own debug_dir is unset, the global debug_dir applies under the server's name, so one setting turns verification logs on for every server. This renames the setting on the servers that already had it (swe_rebench, the swemer servers and swe_internal_v1). No release has included it, so the old name is not kept. resources_servers/swebench/ verification_logs.py is removed. The swebench server runs the harness in async_temp_folder and keeps the folder through keep_as when debug files are on. The opencode agent's fallback for an unset artifacts_dir is async_temp_folder, so its parent follows the global temp_dir. Signed-off-by: Ananth Subramaniam <[email protected]>
Under debug_folder a report sits several levels below the verification folder, so copying the first path segment copied the whole verification tree for each failed sample. Copy the report's own verification folder, and say which folder to pass. Signed-off-by: Ananth Subramaniam <[email protected]>
…_dir explicit save_dir call, and leaves keeping files to each server. Each SWE server now has keep_verification_logs, off by default. Every verification attempt writes its logs into a temporary folder on the node, which is removed when the attempt ends. With the setting on, the folder is copied once into <results_dir>/<server name>/verification/<rollout>/<time>-<instance id>-attempt<n>-<random>/ after the attempt, even when it fails. So a verify never writes into the checkout or onto shared storage while it runs. run_keeping_logs in resources_servers/swebench/verification_logs.py does this for all thirteen servers. The servers that report a log folder in their verify response report the kept copy, or nothing when logs are not kept. Signed-off-by: Ananth Subramaniam <[email protected]>
… nemo_gym.core swebench_pro kept its verification logs inside the attempt's timeout. When that timeout expired, the copy ran while the task was being cancelled, so save_dir kept nothing for the attempts whose logs matter most. The timeout now ends inside the log folder, before the copy. The runtime file helpers are imported from nemo_gym.core's public API. Signed-off-by: Ananth Subramaniam <[email protected]>
The harness-crash test now also runs with keep_verification_logs on and checks that the failed verify's logs are copied once under the server's results. Signed-off-by: Ananth Subramaniam <[email protected]>
Signed-off-by: Ananth Subramaniam <[email protected]>
SWE-Next sessions now read the global config at startup and stop the verifier sandbox through the shared session base, so the log tests stub both. Signed-off-by: Ananth Subramaniam <[email protected]>
e1eafc6 to
4226d69
Compare
Stacked on #6235, which adds
nemo_gym/core/runtime_files.pywithasync_request_temp_dirandsave_dir. Review and merge #6235 first; until it merges, this PR's diff is against its branch.What changed and why
Six SWE-style resources servers wrote a verification log on every
/verifycall into alogs/folder next to their ownapp.py. In training, that folder is inside the Gym checkout, which the job mounts from Lustre. Each verification therefore created a folder and wrote files into the shared checkout, and nothing ever removed them. Over a training run this adds thousands of files and metadata operations on the shared filesystem.The servers and what each one wrote:
scale_swe,r2e_gym,swe_gymanddenovo_swewrotelogs/<instance_id>/test_output.log.swe_nextwrotelogs/<random id>/attempt-<n>/test_output.log, unless itsverification_log_dirsetting named another folder.swebench_prowrote six files underlogs/run_evaluation/<session_id>/<instance_id>/, so it also added one folder per session.Now each verification attempt writes its logs into a temporary folder on the node, from
async_request_temp_dir, and the folder is removed when the attempt ends. A verify therefore writes nothing into the checkout or onto shared storage while it runs. Each server has akeep_verification_logssetting, off by default. With it on, the attempt's folder is copied once withsave_dirinto<results_dir>/<server name>/verification/<rollout>/<UTC time>-<instance id>-attempt<n>-<random>/after the attempt, even when the attempt fails. The rollout comes from the request, so logs from different rollouts of the same task stay apart, and the random part keeps two copies from sharing a folder.One function,
run_keeping_logsinresources_servers/swebench/verification_logs.py, wraps a verifier call in that temporary folder and keeps the copy when asked. All thirteen servers below call it.swe_rebench, theswemer_*servers andswe_internal_v1already had an opt-in setting calledverification_log_dir, and each built its log path inline.swe_nexthad a setting with the same name that only moved its logs elsewhere. These servers now usekeep_verification_logsandrun_keeping_logstoo.swebench_pro'srun_verificationused to require a log folder; it now also acceptsNoneand then writes nothing.swebench_pro_v2overrides only the verifier call, so it inherits the same temporary folder and the same setting.The
swebenchresources server, which grades SWE-bench Multilingual, ran the SWE-bench harness with its default log folder. That default is relative to the working directory, which is the server's own source folder. So every verify built alogs/run_evaluation/<run_id>tree in the checkout, searched it for the test output and then deleted it, and a verify that was interrupted left its tree behind.run_instancenow takes the log folder as an argument, and the server runs it throughrun_keeping_logslike the other servers.opencode_sandboxed_agenthas the same problem in a different form. Whenartifacts_dirwas unset, it downloaded each session's OpenCode export and database snapshot into aresults/folder next to itsapp.pyand never removed the export. The agent has to download the export to parse it, so it cannot skip the download. Instead, withoutartifacts_dirit now downloads intoasync_request_temp_dir, and the folder is removed once the export and snapshot are parsed. Withartifacts_dirset, nothing changes.The other open PRs on the same Lustre access problem don't touch these files: the run manifest (#6214), model-call claims (#6216), the node-local driver folder (#6217) and
agentic_ifepisodes (#6218). #6236, a cancellation fix in the samerun_instance, will need a small rebase after this one. No issue was filed, because the problem and the fix are both contained in this PR.Compatibility
logs/next to a server'sapp.pymust now setkeep_verification_logs: trueand read the logs under the server's results folder.swe_next,swe_rebench, theswemer_*servers andswe_internal_v1replaceverification_log_dirwithkeep_verification_logs, and their kept logs use the layout above. No release has includedverification_log_dir, so the old setting is not kept. The verify responses ofswe_rebench, theswemer_*servers andswe_internal_v1still report the kept folder in a field namedverification_log_dir.swebench'sclear_swebench_debug_logsno longer has an effect, because the harness logs are always removed. It is still accepted so existing configs load. When it is set tofalsewithoutkeep_verification_logs, the server logs a warning that says how to keep the logs. Golden-patch verification no longer keeps logs by default, andanalyze_golden_patch_logs.pynow takes the folder of kept verification logs as its argument and copies each failed sample's own kept folder.log_dirfield in theswebenchandswebench_proverify responses names the kept copy, and is an empty string when logs are not kept.artifacts_dir,opencode_sandboxed_agentnow returns an emptyopencode_results_fpath, because the export it named is gone by the time the response returns. No code in Gym reads that field.Validation
keep_verification_logson, they check that one copy lands under<server>/verification/with the instance id and attempt in its name. Forswebench_pro, a test also checks thelog_dirfield in the verify response.swebench_protest makes an attempt hang past its timeout and checks that its partial log is still kept. Before this change, the copy ran inside the expired timeout and kept nothing.swebench_protest runsrun_verificationwith no log folder and checks that it grades the run without writing any file.swebenchtests stand in for the harness and check the same temporary folder and kept copy, and that a verify where the harness fails still removes its temporary folder and, withkeep_verification_logson, keeps its copy. They also check that a config withclear_swebench_debug_logsstill loads.swebenchtest runs the realrun_instancewith a separate log folder and an empty working directory. It checks that the test output and report land in the log folder and that nothing is written to the working directory.upstream/mainand pass on this branch.pytestpassed for the tests of every touched resources server,resources_servers/swebench(with theswebenchlibrary installed),responses_api_agents/opencode_sandboxed_agentand feat(core): add temporary dir helpers, save_dir and temp_dir for runtime files #6235's runtime file tests.pre-commit runpassed on the changed files.Rollout evidence
N/A. The patch capture, the scripts that run in the sandbox and the grading code do not change. The only change is where the server writes its copies of the logs on its own host, and whether it keeps them. The new tests drive
/verifyon each server and check the folders the verifier writes to and what is kept.