Marquis03 commited on
Commit
f60599c
·
verified ·
1 Parent(s): 17af630

Upload folder using huggingface_hub (part 37)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +55 -0
  2. patrykcieslak--stonefish.09208f9/tests/programgym_task.json +308 -0
  3. patrykcieslak--stonefish.09208f9/tests/test.sh +82 -0
  4. patrykcieslak--stonefish.09208f9/tests/workspace.tar.gz +3 -0
  5. patwie--cppnumericalsolvers.14a9/environment/Dockerfile +66 -0
  6. patwie--cppnumericalsolvers.14a9/environment/docker-compose.yaml +11 -0
  7. patwie--cppnumericalsolvers.14a9/environment/download.sh +40 -0
  8. patwie--cppnumericalsolvers.14a9/environment/executable +3 -0
  9. patwie--cppnumericalsolvers.14a9/environment/harbor_configure_apt_mirror.sh +37 -0
  10. patwie--cppnumericalsolvers.14a9/environment/harbor_prepare_download_env.sh +34 -0
  11. patwie--cppnumericalsolvers.14a9/environment/workspace.tar.gz +3 -0
  12. patwie--cppnumericalsolvers.14a9/instruction.md +98 -0
  13. patwie--cppnumericalsolvers.14a9/solution/solve.sh +33 -0
  14. patwie--cppnumericalsolvers.14a9/task.toml +69 -0
  15. patwie--cppnumericalsolvers.14a9/tests/Dockerfile +74 -0
  16. patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  17. patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  18. patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  19. patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  20. patwie--cppnumericalsolvers.14a9/tests/docker-compose.yaml +11 -0
  21. patwie--cppnumericalsolvers.14a9/tests/download.sh +40 -0
  22. patwie--cppnumericalsolvers.14a9/tests/executable +3 -0
  23. patwie--cppnumericalsolvers.14a9/tests/harbor_configure_apt_mirror.sh +37 -0
  24. patwie--cppnumericalsolvers.14a9/tests/harbor_prepare_download_env.sh +34 -0
  25. patwie--cppnumericalsolvers.14a9/tests/programgym_evaluator.py +1201 -0
  26. patwie--cppnumericalsolvers.14a9/tests/programgym_task.json +808 -0
  27. patwie--cppnumericalsolvers.14a9/tests/test.sh +82 -0
  28. patwie--cppnumericalsolvers.14a9/tests/workspace.tar.gz +3 -0
  29. pauldreik--rdfind.e50c817/environment/Dockerfile +66 -0
  30. pauldreik--rdfind.e50c817/environment/docker-compose.yaml +11 -0
  31. pauldreik--rdfind.e50c817/environment/download.sh +36 -0
  32. pauldreik--rdfind.e50c817/environment/executable +3 -0
  33. pauldreik--rdfind.e50c817/environment/harbor_configure_apt_mirror.sh +37 -0
  34. pauldreik--rdfind.e50c817/environment/harbor_prepare_download_env.sh +34 -0
  35. pauldreik--rdfind.e50c817/environment/workspace.tar.gz +3 -0
  36. pauldreik--rdfind.e50c817/instruction.md +98 -0
  37. pauldreik--rdfind.e50c817/solution/solve.sh +33 -0
  38. pauldreik--rdfind.e50c817/task.toml +69 -0
  39. pauldreik--rdfind.e50c817/tests/Dockerfile +74 -0
  40. pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  41. pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  42. pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  43. pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  44. pauldreik--rdfind.e50c817/tests/docker-compose.yaml +11 -0
  45. pauldreik--rdfind.e50c817/tests/download.sh +36 -0
  46. pauldreik--rdfind.e50c817/tests/executable +3 -0
  47. pauldreik--rdfind.e50c817/tests/harbor_configure_apt_mirror.sh +37 -0
  48. pauldreik--rdfind.e50c817/tests/harbor_prepare_download_env.sh +34 -0
  49. pauldreik--rdfind.e50c817/tests/programgym_evaluator.py +1201 -0
  50. pauldreik--rdfind.e50c817/tests/programgym_task.json +803 -0
.gitattributes CHANGED
@@ -2004,3 +2004,58 @@ padok-team--yatas.10ffdfe/environment/executable filter=lfs diff=lfs merge=lfs -
2004
  padok-team--yatas.10ffdfe/tests/executable filter=lfs diff=lfs merge=lfs -text
2005
  patrikhuber--eos.ce98420/environment/executable filter=lfs diff=lfs merge=lfs -text
2006
  patrikhuber--eos.ce98420/tests/executable filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2004
  padok-team--yatas.10ffdfe/tests/executable filter=lfs diff=lfs merge=lfs -text
2005
  patrikhuber--eos.ce98420/environment/executable filter=lfs diff=lfs merge=lfs -text
2006
  patrikhuber--eos.ce98420/tests/executable filter=lfs diff=lfs merge=lfs -text
2007
+ patwie--cppnumericalsolvers.14a9/environment/executable filter=lfs diff=lfs merge=lfs -text
2008
+ patwie--cppnumericalsolvers.14a9/tests/executable filter=lfs diff=lfs merge=lfs -text
2009
+ pauldreik--rdfind.e50c817/environment/executable filter=lfs diff=lfs merge=lfs -text
2010
+ pauldreik--rdfind.e50c817/tests/executable filter=lfs diff=lfs merge=lfs -text
2011
+ paulftw--hiberlite.ffd558a/environment/executable filter=lfs diff=lfs merge=lfs -text
2012
+ paulftw--hiberlite.ffd558a/tests/executable filter=lfs diff=lfs merge=lfs -text
2013
+ paullouisageneau--violet.42b9457/environment/executable filter=lfs diff=lfs merge=lfs -text
2014
+ paullouisageneau--violet.42b9457/tests/executable filter=lfs diff=lfs merge=lfs -text
2015
+ pboettch--json-schema-validator/environment/executable filter=lfs diff=lfs merge=lfs -text
2016
+ pboettch--json-schema-validator/tests/executable filter=lfs diff=lfs merge=lfs -text
2017
+ pcarrier--gauth.0711b62/environment/executable filter=lfs diff=lfs merge=lfs -text
2018
+ pcarrier--gauth.0711b62/tests/executable filter=lfs diff=lfs merge=lfs -text
2019
+ pcasteran--terraform-graph-beaut/environment/executable filter=lfs diff=lfs merge=lfs -text
2020
+ pcasteran--terraform-graph-beaut/tests/executable filter=lfs diff=lfs merge=lfs -text
2021
+ pcb9382--stereoalgorithms.e6e14a/environment/executable filter=lfs diff=lfs merge=lfs -text
2022
+ pcb9382--stereoalgorithms.e6e14a/tests/executable filter=lfs diff=lfs merge=lfs -text
2023
+ pcwalton--cxx-async.098fbfc/environment/executable filter=lfs diff=lfs merge=lfs -text
2024
+ pcwalton--cxx-async.098fbfc/tests/executable filter=lfs diff=lfs merge=lfs -text
2025
+ pearkes--gethub.c74295b/environment/executable filter=lfs diff=lfs merge=lfs -text
2026
+ pearkes--gethub.c74295b/tests/executable filter=lfs diff=lfs merge=lfs -text
2027
+ pebal--sgcl.cc5bd4b/environment/executable filter=lfs diff=lfs merge=lfs -text
2028
+ pebal--sgcl.cc5bd4b/tests/executable filter=lfs diff=lfs merge=lfs -text
2029
+ pelletier--go-toml.21f8286/environment/executable filter=lfs diff=lfs merge=lfs -text
2030
+ pelletier--go-toml.21f8286/tests/executable filter=lfs diff=lfs merge=lfs -text
2031
+ pentestpad--subzy.f2e2ec7/environment/executable filter=lfs diff=lfs merge=lfs -text
2032
+ pentestpad--subzy.f2e2ec7/tests/executable filter=lfs diff=lfs merge=lfs -text
2033
+ perplexityai--bumblebee.cc57710/environment/executable filter=lfs diff=lfs merge=lfs -text
2034
+ perplexityai--bumblebee.cc57710/tests/executable filter=lfs diff=lfs merge=lfs -text
2035
+ petejkim--goop.78b83e4/environment/executable filter=lfs diff=lfs merge=lfs -text
2036
+ petejkim--goop.78b83e4/tests/executable filter=lfs diff=lfs merge=lfs -text
2037
+ peter-winter--ctpg.624b4d1/environment/executable filter=lfs diff=lfs merge=lfs -text
2038
+ peter-winter--ctpg.624b4d1/tests/executable filter=lfs diff=lfs merge=lfs -text
2039
+ pezmaster31--bamtools.7e5c183/environment/executable filter=lfs diff=lfs merge=lfs -text
2040
+ pezmaster31--bamtools.7e5c183/tests/executable filter=lfs diff=lfs merge=lfs -text
2041
+ philip82148--cpp-dump.aabd98d/environment/executable filter=lfs diff=lfs merge=lfs -text
2042
+ philip82148--cpp-dump.aabd98d/tests/executable filter=lfs diff=lfs merge=lfs -text
2043
+ phillbush--jvm.3b601a0/environment/executable filter=lfs diff=lfs merge=lfs -text
2044
+ phillbush--jvm.3b601a0/tests/executable filter=lfs diff=lfs merge=lfs -text
2045
+ phkaeser--wlmaker.e7261a0/environment/executable filter=lfs diff=lfs merge=lfs -text
2046
+ phkaeser--wlmaker.e7261a0/tests/executable filter=lfs diff=lfs merge=lfs -text
2047
+ pierrec--lz4.a296161/environment/executable filter=lfs diff=lfs merge=lfs -text
2048
+ pierrec--lz4.a296161/tests/executable filter=lfs diff=lfs merge=lfs -text
2049
+ pijng--prep.bb7c85d/environment/executable filter=lfs diff=lfs merge=lfs -text
2050
+ pijng--prep.bb7c85d/tests/executable filter=lfs diff=lfs merge=lfs -text
2051
+ pikalabs--pink.a2b4ac9/environment/executable filter=lfs diff=lfs merge=lfs -text
2052
+ pikalabs--pink.a2b4ac9/tests/executable filter=lfs diff=lfs merge=lfs -text
2053
+ pilagod--gorm-cursor-paginator.d/environment/executable filter=lfs diff=lfs merge=lfs -text
2054
+ pilagod--gorm-cursor-paginator.d/tests/executable filter=lfs diff=lfs merge=lfs -text
2055
+ pippy360--transformationinvarian/environment/executable filter=lfs diff=lfs merge=lfs -text
2056
+ pippy360--transformationinvarian/tests/executable filter=lfs diff=lfs merge=lfs -text
2057
+ pkg--browser.5ac0b6a/environment/executable filter=lfs diff=lfs merge=lfs -text
2058
+ pkg--browser.5ac0b6a/tests/executable filter=lfs diff=lfs merge=lfs -text
2059
+ pksunkara--cargo-workspaces.4165/environment/executable filter=lfs diff=lfs merge=lfs -text
2060
+ pksunkara--cargo-workspaces.4165/tests/executable filter=lfs diff=lfs merge=lfs -text
2061
+ plankcipher--kabmat.0251870/environment/executable filter=lfs diff=lfs merge=lfs -text
patrykcieslak--stonefish.09208f9/tests/programgym_task.json ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_args.test_blank_argument_tolerated",
9
+ "eval.tests.test_args.test_double_dash_tolerated",
10
+ "eval.tests.test_args.test_extra_arguments_tolerated",
11
+ "eval.tests.test_args.test_long_option_like_args_tolerated",
12
+ "eval.tests.test_console_logging.test_all_lines_severity_prefixed",
13
+ "eval.tests.test_console_logging.test_all_stable_lines_use_expected_severity_grammar",
14
+ "eval.tests.test_console_logging.test_error_channel_used",
15
+ "eval.tests.test_console_logging.test_info_channel_used",
16
+ "eval.tests.test_console_logging.test_message_text_preserved",
17
+ "eval.tests.test_console_logging.test_no_critical_abort_in_scenario",
18
+ "eval.tests.test_core_order.test_construction_block_precedes_clock_stream",
19
+ "eval.tests.test_core_order.test_parse_error_block_precedes_live_step",
20
+ "eval.tests.test_determinism.test_clock_sequence_deterministic",
21
+ "eval.tests.test_determinism.test_engine_signature_deterministic",
22
+ "eval.tests.test_determinism.test_parse_error_block_deterministic",
23
+ "eval.tests.test_determinism.test_welcome_banner_before_ready_stable",
24
+ "eval.tests.test_determinism.test_welcome_banner_stable",
25
+ "eval.tests.test_lifecycle.test_initial_conditions_solved",
26
+ "eval.tests.test_lifecycle.test_initialization_sequence_ordered",
27
+ "eval.tests.test_lifecycle.test_physics_backend_reported",
28
+ "eval.tests.test_lifecycle.test_ready_ic_then_first_step_ordering",
29
+ "eval.tests.test_lifecycle.test_scenario_build_step_started",
30
+ "eval.tests.test_lifecycle.test_simulation_enters_running_state",
31
+ "eval.tests.test_lifecycle.test_version_banner",
32
+ "eval.tests.test_parse_and_errors.test_fatal_parse_error_uses_error_severity",
33
+ "eval.tests.test_parse_and_errors.test_parse_failure_does_not_abort_lifecycle",
34
+ "eval.tests.test_parse_and_errors.test_parser_emits_fatal_parse_error_marker",
35
+ "eval.tests.test_parse_and_errors.test_parser_logs_scenario_file_identity",
36
+ "eval.tests.test_parse_and_errors.test_parser_reports_load_attempt_of_primary_scenario",
37
+ "eval.tests.test_run_contract.test_console_app_runs_indefinitely_until_harness_kill",
38
+ "eval.tests.test_run_contract.test_content_gate_captures_exact_step_count",
39
+ "eval.tests.test_simulation_time.test_all_clock_steps_follow_readiness",
40
+ "eval.tests.test_simulation_time.test_clock_bounded_by_run_deadline",
41
+ "eval.tests.test_simulation_time.test_clock_span_is_integer_multiple_of_step",
42
+ "eval.tests.test_simulation_time.test_clock_starts_at_first_step",
43
+ "eval.tests.test_simulation_time.test_clock_strictly_increases",
44
+ "eval.tests.test_simulation_time.test_fixed_step_increment",
45
+ "eval.tests.test_simulation_time.test_many_steps_captured"
46
+ ]
47
+ },
48
+ "generated_module_02": {
49
+ "ignore_reason": "",
50
+ "ignored": false,
51
+ "ignored_tests": [],
52
+ "tests": [
53
+ "eval.tests.test_entities_error_paths.test_parse_failure_recovery_chain_is_reproducible",
54
+ "eval.tests.test_entities_error_paths.test_parse_failure_recovery_is_invariant_to_cli_arguments",
55
+ "eval.tests.test_entities_error_paths.test_parse_failure_reported_then_construction_recovers",
56
+ "eval.tests.test_entities_robustness.test_entity_scene_construction_ignores_working_directory",
57
+ "eval.tests.test_entities_robustness.test_entity_scene_lifecycle_is_invariant_to_environment_variables",
58
+ "eval.tests.test_entities_robustness.test_parse_error_is_contained_within_scene_construction_stage",
59
+ "eval.tests.test_entities_simulation.test_diagnostics_routed_to_stdout_not_stderr",
60
+ "eval.tests.test_entities_simulation.test_first_simulation_sample_equals_fixed_step",
61
+ "eval.tests.test_entities_simulation.test_repeated_runs_produce_identical_normalized_lifecycle",
62
+ "eval.tests.test_entities_simulation.test_simulation_time_advances_by_fixed_step",
63
+ "eval.tests.test_entities_simulation.test_startup_lifecycle_invariant_to_cli_arguments",
64
+ "eval.tests.test_entities_startup.test_bullet_backend_reported_on_initialization",
65
+ "eval.tests.test_entities_startup.test_console_prints_version_banner_before_scene_construction",
66
+ "eval.tests.test_entities_startup.test_readiness_chain_progresses_in_exact_order",
67
+ "eval.tests.test_entities_startup.test_scene_construction_precedes_motion_state_synchronization"
68
+ ]
69
+ },
70
+ "generated_module_03": {
71
+ "ignore_reason": "",
72
+ "ignored": false,
73
+ "ignored_tests": [
74
+ {
75
+ "name": "eval.tests.test_console_joints.test_scenario_parse_error_contract",
76
+ "reasons": [
77
+ {
78
+ "id": "missing_fixture_assets",
79
+ "message": "pytest test references fixture assets that are not packaged",
80
+ "path": "eval/tests/test_console_joints.py",
81
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
82
+ "severity": "error",
83
+ "stage": "static_lint"
84
+ }
85
+ ]
86
+ }
87
+ ],
88
+ "tests": [
89
+ "eval.tests.test_console_joints.test_console_output_reaches_stdout",
90
+ "eval.tests.test_console_joints.test_headless_binary_does_not_exit_on_its_own",
91
+ "eval.tests.test_console_joints.test_materials_or_scenario_load_error",
92
+ "eval.tests.test_console_joints.test_robot_kinematic_tree_zero_joints",
93
+ "eval.tests.test_console_joints.test_robot_link_mass_is_reported",
94
+ "eval.tests.test_console_joints.test_scenario_lifecycle_reports_sync",
95
+ "eval.tests.test_console_joints.test_scenario_outcome_is_deterministic",
96
+ "eval.tests.test_console_joints.test_scenario_parse_error_contract",
97
+ "eval.tests.test_console_joints.test_scenario_parser_reports_scenario_path",
98
+ "eval.tests.test_console_joints.test_simulation_initialized_and_ready",
99
+ "eval.tests.test_console_joints.test_simulation_steps_and_reports_time",
100
+ "eval.tests.test_console_joints.test_thruster_actuators_configured",
101
+ "eval.tests.test_console_joints.test_welcome_and_initialization_banner"
102
+ ]
103
+ },
104
+ "generated_module_04": {
105
+ "ignore_reason": "",
106
+ "ignored": false,
107
+ "ignored_tests": [],
108
+ "tests": [
109
+ "eval.tests.test_actuators_simulation.TestActuatorDataValidity.test_ic_solve_duration_is_emitted_with_fixed_six_decimal_precision",
110
+ "eval.tests.test_actuators_simulation.TestActuatorDataValidity.test_ic_solve_iterations_is_positive_and_duration_is_finite",
111
+ "eval.tests.test_actuators_simulation.TestActuatorDataValidity.test_sim_time_values_are_quantized_to_the_fixed_step_multiple",
112
+ "eval.tests.test_actuators_simulation.TestDeterminism.test_startup_milestone_sequence_is_deterministic_across_runs",
113
+ "eval.tests.test_actuators_simulation.TestPhysicsAndStep.test_initial_condition_solver_runs_between_ready_and_steps",
114
+ "eval.tests.test_actuators_simulation.TestPhysicsAndStep.test_physics_init_precedes_ready_transition",
115
+ "eval.tests.test_actuators_simulation.TestPhysicsAndStep.test_ready_line_is_directly_succeeded_by_ic_solve",
116
+ "eval.tests.test_actuators_simulation.TestPhysicsAndStep.test_sim_time_stream_after_first_step_is_clean_and_monotonic",
117
+ "eval.tests.test_actuators_simulation.TestPhysicsAndStep.test_simulation_time_advances_in_fixed_steps",
118
+ "eval.tests.test_actuators_simulation.TestStartupPreamble.test_initialization_phase_sequence_is_ordered",
119
+ "eval.tests.test_actuators_simulation.TestStartupPreamble.test_scenario_parser_emits_parse_error_before_physics_init",
120
+ "eval.tests.test_actuators_simulation.TestStartupPreamble.test_scenario_parser_targets_console_test",
121
+ "eval.tests.test_actuators_simulation.TestStartupPreamble.test_welcome_banner_is_the_first_output_line"
122
+ ]
123
+ },
124
+ "generated_module_05": {
125
+ "ignore_reason": "",
126
+ "ignored": false,
127
+ "ignored_tests": [],
128
+ "tests": [
129
+ "eval.tests.test_sim_behavior.test_all_five_thruster_actuators_initialized",
130
+ "eval.tests.test_sim_behavior.test_auv_vehicle_link_metrics",
131
+ "eval.tests.test_sim_behavior.test_dangling_contact_reported",
132
+ "eval.tests.test_sim_behavior.test_dynamic_ball_mass_deterministic",
133
+ "eval.tests.test_sim_behavior.test_initial_conditions_solved",
134
+ "eval.tests.test_sim_behavior.test_kinematic_tree_single_link_no_joints",
135
+ "eval.tests.test_sim_behavior.test_ocean_simulation_enabled",
136
+ "eval.tests.test_sim_behavior.test_runs_environment_synchronized_then_ready",
137
+ "eval.tests.test_sim_behavior.test_scenario_materials_created_in_order",
138
+ "eval.tests.test_sim_behavior.test_scenario_parse_failure_reported",
139
+ "eval.tests.test_sim_behavior.test_scenario_parser_loads_console_test",
140
+ "eval.tests.test_sim_behavior.test_simulation_initialized_with_bullet",
141
+ "eval.tests.test_sim_behavior.test_stepping_loop_fixed_dt_interval",
142
+ "eval.tests.test_sim_behavior.test_stepping_loop_produces_monotonic_sim_time",
143
+ "eval.tests.test_sim_behavior.test_stepping_loop_tick_format_exact",
144
+ "eval.tests.test_sim_behavior.test_two_phase_scenario_build_ordering",
145
+ "eval.tests.test_sim_behavior.test_version_banner_present",
146
+ "eval.tests.test_sim_behavior.test_world_reconstruction_reloads_scenario"
147
+ ]
148
+ },
149
+ "generated_module_06": {
150
+ "ignore_reason": "",
151
+ "ignored": false,
152
+ "ignored_tests": [],
153
+ "tests": [
154
+ "eval.tests.test_sensors.test_console_banner_and_initialization_sequence",
155
+ "eval.tests.test_sensors.test_console_sim_is_a_persistent_stepping_process",
156
+ "eval.tests.test_sensors.test_extra_command_line_arguments_are_ignored",
157
+ "eval.tests.test_sensors.test_initialization_completes_into_fixed_rate_stepping",
158
+ "eval.tests.test_sensors.test_sensor_loop_clock_is_zero_phase_and_never_resets_midrun",
159
+ "eval.tests.test_sensors.test_sensor_loop_integrates_time_without_drift",
160
+ "eval.tests.test_sensors.test_sensor_loop_is_deterministic_across_independent_runs",
161
+ "eval.tests.test_sensors.test_sensor_loop_sampling_grid_is_phase_locked",
162
+ "eval.tests.test_sensors.test_sensor_loop_sustains_fixed_rate_without_stall",
163
+ "eval.tests.test_sensors.test_sensors_do_not_emit_measurement_artifacts",
164
+ "eval.tests.test_sensors.test_sim_clock_advances_at_fixed_500hz_rate",
165
+ "eval.tests.test_sensors.test_stdin_is_ignored"
166
+ ]
167
+ },
168
+ "generated_module_07": {
169
+ "ignore_reason": "",
170
+ "ignored": false,
171
+ "ignored_tests": [],
172
+ "tests": [
173
+ "eval.tests.test_reference_console.test_announces_stonefish_version",
174
+ "eval.tests.test_reference_console.test_enters_ready_state_and_steps_simulation",
175
+ "eval.tests.test_reference_console.test_init_milestones_are_emitted_in_order",
176
+ "eval.tests.test_reference_console.test_initializes_bullet_physics_engine",
177
+ "eval.tests.test_simulation_advance.test_all_output_on_stdout_with_empty_stderr",
178
+ "eval.tests.test_simulation_advance.test_per_step_time_is_strictly_monotonic",
179
+ "eval.tests.test_simulation_advance.test_simulation_keeps_advancing_across_long_window",
180
+ "eval.tests.test_simulation_advance.test_simulation_reaches_exact_far_instants",
181
+ "eval.tests.test_simulation_advance.test_simulation_time_ladder_is_exactly_periodic"
182
+ ]
183
+ },
184
+ "generated_upstream": {
185
+ "ignore_reason": "",
186
+ "ignored": false,
187
+ "ignored_tests": [],
188
+ "tests": [
189
+ "eval.tests.test_console_app.test_console_app_emits_boot_transcript",
190
+ "eval.tests.test_console_app.test_console_app_steps_fixed_interval",
191
+ "eval.tests.test_console_app.test_console_app_steps_format_three_decimals"
192
+ ]
193
+ }
194
+ },
195
+ "commit": "09208f913daf688cc8abc775d45742c860c81f19",
196
+ "data_source": "synthetic_programgym",
197
+ "difficulty": "hard",
198
+ "difficulty_score": 4.040301631472254,
199
+ "eval_clean_hashes": [
200
+ "21b531674a1b5b4a26ba64154291fe2e3572073ea6ba32bc593272548c830f34"
201
+ ],
202
+ "input_record": {
203
+ "commit": "09208f913daf688cc8abc775d45742c860c81f19",
204
+ "full_name": "patrykcieslak/stonefish",
205
+ "input_joern_zip": "cpp_joern/patrykcieslak__stonefish.zip",
206
+ "joern_status": true,
207
+ "joern_time": 57.689322950085625,
208
+ "language": "cpp",
209
+ "pb_match": [
210
+ {
211
+ "pb_fullname": "gromacs/gromacs",
212
+ "rank": 29,
213
+ "similarity": 0.5822516679763794
214
+ },
215
+ {
216
+ "pb_fullname": "OSGeo/PROJ",
217
+ "rank": 785,
218
+ "similarity": 0.3921164870262146
219
+ },
220
+ {
221
+ "pb_fullname": "HaliteChallenge/Halite",
222
+ "rank": 971,
223
+ "similarity": 0.42275136709213257
224
+ }
225
+ ],
226
+ "repo_path": "cpp/patrykcieslak__stonefish",
227
+ "source": "commit:09208f913daf688cc8abc775d45742c860c81f19",
228
+ "status": "done",
229
+ "url": "https://github.com/patrykcieslak/stonefish"
230
+ },
231
+ "instance_id": "patrykcieslak__stonefish.09208f9",
232
+ "language": "cpp",
233
+ "module_iterations": [
234
+ {
235
+ "actual_iterations": 7,
236
+ "branch_name": "generated_module_01",
237
+ "iteration_limit": 20,
238
+ "module_index": 1,
239
+ "module_kind": "source",
240
+ "termination_reason": "early_stopping"
241
+ },
242
+ {
243
+ "actual_iterations": 6,
244
+ "branch_name": "generated_module_02",
245
+ "iteration_limit": 20,
246
+ "module_index": 2,
247
+ "module_kind": "source",
248
+ "termination_reason": "early_stopping"
249
+ },
250
+ {
251
+ "actual_iterations": 5,
252
+ "branch_name": "generated_module_03",
253
+ "iteration_limit": 20,
254
+ "module_index": 3,
255
+ "module_kind": "source",
256
+ "termination_reason": "early_stopping"
257
+ },
258
+ {
259
+ "actual_iterations": 6,
260
+ "branch_name": "generated_module_04",
261
+ "iteration_limit": 20,
262
+ "module_index": 4,
263
+ "module_kind": "source",
264
+ "termination_reason": "early_stopping"
265
+ },
266
+ {
267
+ "actual_iterations": 5,
268
+ "branch_name": "generated_module_05",
269
+ "iteration_limit": 20,
270
+ "module_index": 5,
271
+ "module_kind": "source",
272
+ "termination_reason": "early_stopping"
273
+ },
274
+ {
275
+ "actual_iterations": 7,
276
+ "branch_name": "generated_module_06",
277
+ "iteration_limit": 20,
278
+ "module_index": 6,
279
+ "module_kind": "source",
280
+ "termination_reason": "early_stopping"
281
+ },
282
+ {
283
+ "actual_iterations": 7,
284
+ "branch_name": "generated_module_07",
285
+ "iteration_limit": 20,
286
+ "module_index": 7,
287
+ "module_kind": "source",
288
+ "termination_reason": "early_stopping"
289
+ },
290
+ {
291
+ "actual_iterations": 20,
292
+ "branch_name": "generated_module_08",
293
+ "iteration_limit": 20,
294
+ "module_index": 8,
295
+ "module_kind": "source",
296
+ "termination_reason": "max_iterations"
297
+ },
298
+ {
299
+ "actual_iterations": 5,
300
+ "branch_name": "generated_upstream",
301
+ "iteration_limit": 20,
302
+ "module_index": 9,
303
+ "module_kind": "tests",
304
+ "termination_reason": "early_stopping"
305
+ }
306
+ ],
307
+ "repository": "patrykcieslak/stonefish"
308
+ }
patrykcieslak--stonefish.09208f9/tests/test.sh ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets).
5
+ export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}"
6
+
7
+ mkdir -p /logs/verifier /logs/artifacts
8
+
9
+ write_failure() {
10
+ local code="$1"
11
+ local details="$2"
12
+ python3 - "$code" "$details" <<'PY'
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ code, details = sys.argv[1:3]
18
+ try:
19
+ metadata = json.loads(Path("/tests/programgym_task.json").read_text())
20
+ n_tests = sum(
21
+ len([
22
+ name for name in info.get("tests", [])
23
+ if name not in {item.get("name") for item in info.get("ignored_tests", [])}
24
+ ])
25
+ for branch, info in metadata.get("branches", {}).items()
26
+ if not info.get("ignored")
27
+ )
28
+ except Exception:
29
+ n_tests = 0
30
+ result = {
31
+ "test_results": [],
32
+ "error_code": code,
33
+ "error_details": details,
34
+ "log": [],
35
+ "solution_branch": "submission",
36
+ "test_branches": [],
37
+ "test_branch_errors": {
38
+ "__infra__": [{"error_code": code, "error_details": details}]
39
+ },
40
+ "executable_hash": None,
41
+ "warnings": [],
42
+ }
43
+ diagnostics = {
44
+ "pass_rate": 0.0,
45
+ "resolved": 0,
46
+ "n_passed": 0,
47
+ "n_tests": n_tests,
48
+ "n_branch_errors": 1,
49
+ "infra_error": 1,
50
+ "executable_hash_present": 0,
51
+ }
52
+ Path("/logs/verifier/programgym_eval.json").write_text(
53
+ json.dumps(result, indent=2, sort_keys=True)
54
+ )
55
+ Path("/logs/verifier/harbor_diagnostics.json").write_text(
56
+ json.dumps(diagnostics, indent=2, sort_keys=True)
57
+ )
58
+ Path("/logs/verifier/reward.json").write_text(
59
+ json.dumps(
60
+ {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0},
61
+ indent=2,
62
+ sort_keys=True,
63
+ )
64
+ )
65
+ Path("/logs/verifier/reward.txt").write_text("0.0")
66
+ Path("/logs/verifier/programgym_eval.log").write_text(details)
67
+ PY
68
+ }
69
+
70
+ if ! command -v python3 >/dev/null 2>&1; then
71
+ write_failure "missing_python3" "python3 is required in the cleanroom image"
72
+ exit 0
73
+ fi
74
+
75
+ if ! python3 /tests/programgym_evaluator.py; then
76
+ if [ ! -s /logs/verifier/reward.txt ]; then
77
+ write_failure "evaluator_crashed" \
78
+ "programgym_evaluator.py exited non-zero with no reward written"
79
+ fi
80
+ fi
81
+
82
+ exit 0
patrykcieslak--stonefish.09208f9/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a6af2c428996adce2f729d215b3d6e3055189d187ee48b00547901213bc9707
3
+ size 106516
patwie--cppnumericalsolvers.14a9/environment/Dockerfile ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV PAGER=cat
35
+ ENV MANPAGER=cat
36
+ ENV LESS=-R
37
+ ENV TQDM_DISABLE=1
38
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/*
39
+ ARG CMAKE_VERSION=3.31.12
40
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
41
+ ARG GCC_VERSION=13.3.0
42
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true
43
+ WORKDIR /workspace
44
+ ADD workspace.tar.gz /workspace/
45
+ COPY executable /workspace/executable
46
+ COPY download.sh /workspace/download.sh
47
+ RUN chmod 755 /workspace/download.sh
48
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
49
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
50
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
51
+ && rm -f /workspace/download.sh \
52
+ && rm -f /tmp/harbor_prepare_download_env.sh
53
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
54
+ RUN chmod 111 /workspace/executable
55
+ WORKDIR /workspace
56
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
57
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
58
+ # submission handed to the separate verifier. Keep the reference executable
59
+ # execute-only; the oracle temporarily restores owner read permission.
60
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
61
+ RUN mkdir -p /home/agent \
62
+ && chown -R agent:agent /home/agent /workspace \
63
+ && chown agent:agent /workspace/executable \
64
+ && chmod 111 /workspace/executable
65
+ ENV HOME=/home/agent
66
+ WORKDIR /workspace
patwie--cppnumericalsolvers.14a9/environment/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
patwie--cppnumericalsolvers.14a9/environment/download.sh ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #
3
+ # download.sh — dependency prefetch for CppNumericalSolvers
4
+ #
5
+ # This script ONLY installs/prefetches the external build dependencies that
6
+ # build.sh needs to compile the 'simple' example. It does not compile, link,
7
+ # test, or package anything.
8
+ #
9
+ # It is designed to be SOURCED (source /source_ro/download.sh), not executed,
10
+ # so it keeps exported env vars in the current shell and never calls `exit` in
11
+ # normal control flow. On a hard failure it returns nonzero so the caller sees
12
+ # the failure.
13
+ #
14
+ # Dependencies (all from Ubuntu 22.04 apt, versions pinned by the distro):
15
+ # - libeigen3-dev : Eigen3 3.4.0 (header-only linear algebra; the ONLY
16
+ # runtime/library dependency of the repo)
17
+ # - libgtest-dev : GoogleTest 1.11.0 (required by src/examples/CMakeLists
18
+ # which does find_package(GTest REQUIRED)
19
+ # even when building only examples)
20
+ #
21
+ # All package names are written explicitly here; download.sh reads no
22
+ # repository files and requires no network beyond apt.
23
+
24
+ export DEBIAN_FRONTEND=noninteractive
25
+
26
+ echo "==> [download] refresh apt package index (needed because apt in the build image starts with an empty local index)"
27
+
28
+ if ! apt-get update; then
29
+ echo "[download] ERROR: apt-get update failed" >&2
30
+ return 1
31
+ fi
32
+
33
+ echo "==> [download] installing libeigen3-dev + libgtest-dev"
34
+
35
+ if ! apt-get install -y libeigen3-dev libgtest-dev; then
36
+ echo "[download] ERROR: apt-get install of Eigen3/GoogleTest failed" >&2
37
+ return 1
38
+ fi
39
+
40
+ echo "==> [download] complete: Eigen3 and GoogleTest are now available for build.sh"
patwie--cppnumericalsolvers.14a9/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84fa015c0570af8ef662fcd52f99b32f09b2f48b14c198e218a07d52899d2c5b
3
+ size 1189560
patwie--cppnumericalsolvers.14a9/environment/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
patwie--cppnumericalsolvers.14a9/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
patwie--cppnumericalsolvers.14a9/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b380bc842552ac08b62b3e2da292ce94625fc28327044afb2d8ae9efe7eefec
3
+ size 4896
patwie--cppnumericalsolvers.14a9/instruction.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are a helpful assistant that can interact with a computer.
2
+
3
+ This is a reverse-engineering benchmark. You are given a compiled binary and its documentation.
4
+ Your job is to write a new, original codebase from scratch that produces an executable with identical behavior.
5
+ You must figure out the behavior solely by running and interacting with the provided binary.
6
+ Writing original code based on observed behavior is the entire point of this benchmark.
7
+
8
+ Any approach that shortcuts this — finding existing source code, wrapping the binary,
9
+ or installing the original tool — does not count as a solution. It will be detected by an
10
+ automated judge, marked as a disqualification, and scored as a failure.
11
+ The trace will be posted to an online wall of shame.
12
+
13
+ <RULES>
14
+ ## What is not allowed
15
+
16
+ ### 1. Obtaining source code
17
+
18
+ The only source of truth about what the executable does is the executable itself and its
19
+ bundled documentation. You must not search the internet, package registries, or any external
20
+ source for information about this project's source code. Even if you recognize what the
21
+ executable is, you must reimplement it from behavioral observation alone.
22
+
23
+ This includes but is not limited to:
24
+ - Cloning or browsing the original GitHub repository, its forks, or mirrors
25
+ - Downloading the project from package registries: `cargo install <project>`, `go get github.com/<org>/<project>`, `pip install <project>`, `apt-get source <project>`, `npm install <project>`, etc.
26
+ - Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`)
27
+ - Using a package manager to download the project as a dependency and then reading its cached source (e.g., navigating into `~/.cargo/registry/src/` or `$(go env GOPATH)/pkg/mod/`)
28
+ - Searching the web for the project's source code or implementation details
29
+
30
+ ### 2. Wrapping or reusing the original binary
31
+
32
+ Your submission must be a genuine reimplementation. The provided `./executable` is for
33
+ observation only — your final solution must not depend on it or any other pre-built version
34
+ of the same tool at runtime.
35
+
36
+ This includes but is not limited to:
37
+ - Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`)
38
+ - Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`)
39
+ - Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`)
40
+ - Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`)
41
+ - Re-linking prebuilt `.o` object files found in the workspace without writing new source code
42
+
43
+ ### 3. Binary analysis of the provided executable
44
+
45
+ All information about the provided `./executable` must be obtained by interacting with it
46
+ through its normal user interface (CLI flags, stdin/stdout, etc.).
47
+ - You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it
48
+ - You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable`
49
+
50
+ Note: this restriction applies ONLY to the provided `./executable`. You are free to use any
51
+ analysis tools on binaries that you produce yourself during development.
52
+
53
+ ## What IS allowed
54
+
55
+ - Running the executable with any inputs, flags, and arguments to observe its behavior
56
+ - Reading any documentation files bundled in the workspace
57
+ </RULES>
58
+
59
+ ## Task context
60
+
61
+ We want to write the source code for a given executable.
62
+ The executable is located at `./executable` in the workspace root.
63
+
64
+ You also have access to the existing documentation.
65
+
66
+ ## Your task
67
+
68
+ Implement the source code to generate an executable of exactly identical behavior as the original.
69
+
70
+ No project-specific dependencies are pre-installed.
71
+ You do NOT have access to the internet.
72
+ **IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file.
73
+ Finally, commit your changes.
74
+
75
+ Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root.
76
+ `compile.sh` should be executable and should install any dependencies needed to compile the executable.
77
+ If your compile.sh fails to compile on a fresh checkout, your task has failed.
78
+
79
+ ## Important: This is a reverse-engineering benchmark
80
+
81
+ Your goal is to write original code from scratch that reproduces the executable's behavior.
82
+ The only way to learn what the executable does is to run it and read its bundled documentation.
83
+
84
+ Any attempt to obtain source code — whether successful or not — or to wrap/reuse the
85
+ provided binary will be detected by an automated judge, disqualified, and scored as zero.
86
+ See the full rules in the system prompt above. Key points:
87
+
88
+ - Do NOT search the internet, clone repos, or download the project from any package registry
89
+ - Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool
90
+ - Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine)
91
+ - You SHOULD extensively test the executable to understand its behavior before writing code.
92
+ If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it.
93
+
94
+ ## Recommended Workflow
95
+
96
+ 1. Explore all documentation files
97
+ 2. Play with the executable to understand its behavior (however, you MUST NOT decompile `./executable` or perform any other form of binary or strace/ltrace analysis on it)
98
+ 3. Write the source code to implement the behavior
patwie--cppnumericalsolvers.14a9/solution/solve.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Oracle-only ceiling check. The reference is execute-only for normal agents;
3
+ # because the oracle runs as the owning `agent` user it can temporarily add read
4
+ # permission and encode the binary for Harbor's normal artifact handoff.
5
+ set -euo pipefail
6
+ test -f ./executable
7
+ chmod u+r ./executable
8
+ python3 - <<'PY'
9
+ import base64
10
+ from pathlib import Path
11
+
12
+ Path(".programgym_oracle_reference").write_bytes(
13
+ base64.b64encode(Path("executable").read_bytes())
14
+ )
15
+ PY
16
+ chmod u-r ./executable
17
+ cat > compile.sh <<'EOF'
18
+ #!/usr/bin/env bash
19
+ set -euo pipefail
20
+ if [ -f ./.programgym_oracle_reference ]; then
21
+ python3 - <<'PY'
22
+ import base64
23
+ from pathlib import Path
24
+
25
+ Path("executable").write_bytes(
26
+ base64.b64decode(Path(".programgym_oracle_reference").read_bytes())
27
+ )
28
+ PY
29
+ fi
30
+ test -f ./executable
31
+ chmod +x ./executable
32
+ EOF
33
+ chmod +x compile.sh
patwie--cppnumericalsolvers.14a9/task.toml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ source = "ProgramGym"
3
+ artifacts = [
4
+ "/logs/verifier/programgym_eval.json",
5
+ "/logs/verifier/harbor_diagnostics.json",
6
+ "/logs/verifier/programgym_eval.log",
7
+ "/logs/verifier/reward.json",
8
+ "/logs/verifier/reward.txt",
9
+ # Keep agent/runtime state out of the submission handoff. In particular,
10
+ # Claude Code installs an absolute symlink under .local/bin; transferring it
11
+ # makes Python's safe tar extraction reject the entire workspace archive.
12
+ { source = "/workspace", exclude = [
13
+ "executable",
14
+ ".git",
15
+ ".bashrc",
16
+ ".cache",
17
+ ".cc-switch",
18
+ ".claude",
19
+ ".local",
20
+ ] },
21
+ ]
22
+
23
+ [task]
24
+ name = "programgym/patwie--cppnumericalsolvers.14a9"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for PatWie/CppNumericalSolvers"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "PatWie__CppNumericalSolvers.14a997b"
32
+ repository = "PatWie/CppNumericalSolvers"
33
+ commit = "14a997b1368d1647d0b026ab533e6a3f6c41df1e"
34
+ language = "cpp"
35
+ difficulty = "easy"
36
+ difficulty_score = 1.7824009524965296
37
+ test_branches = 4
38
+ test_count = 595
39
+
40
+ [agent]
41
+ timeout_sec = 14400
42
+ user = "agent"
43
+ network_mode = "allowlist"
44
+ allowed_hosts = ["api.anthropic.com", "api.openai.com"]
45
+
46
+ [verifier]
47
+ timeout_sec = 7200
48
+ user = "root"
49
+ environment_mode = "separate"
50
+
51
+ [verifier.env]
52
+ PROGRAMGYM_XDIST_WORKERS = "8"
53
+
54
+ [verifier.environment]
55
+ build_timeout_sec = 1800
56
+ cpus = 8
57
+ memory_mb = 16384
58
+ storage_mb = 30720
59
+ gpus = 0
60
+ workdir = "/workspace"
61
+
62
+ [environment]
63
+ network_mode = "public"
64
+ build_timeout_sec = 1800
65
+ cpus = 8
66
+ memory_mb = 16384
67
+ storage_mb = 30720
68
+ gpus = 0
69
+ workdir = "/workspace"
patwie--cppnumericalsolvers.14a9/tests/Dockerfile ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV PAGER=cat
35
+ ENV MANPAGER=cat
36
+ ENV LESS=-R
37
+ ENV TQDM_DISABLE=1
38
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/*
39
+ ARG CMAKE_VERSION=3.31.12
40
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
41
+ ARG GCC_VERSION=13.3.0
42
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true
43
+ WORKDIR /workspace
44
+ ADD workspace.tar.gz /workspace/
45
+ COPY executable /workspace/executable
46
+ COPY download.sh /workspace/download.sh
47
+ RUN chmod 755 /workspace/download.sh
48
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
49
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
50
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
51
+ && rm -f /workspace/download.sh \
52
+ && rm -f /tmp/harbor_prepare_download_env.sh
53
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
54
+ RUN chmod 111 /workspace/executable
55
+ WORKDIR /workspace
56
+ # Harbor uses tests/ as the separate verifier build context. Start with the
57
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
58
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
59
+ && mkdir -p /workspace /tests
60
+
61
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
62
+ # Installing a newer pytest alone leaves that apt package importable and creates
63
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
64
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
65
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
66
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
67
+ RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
68
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
69
+
70
+ COPY test.sh /tests/test.sh
71
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
72
+ COPY programgym_task.json /tests/programgym_task.json
73
+ COPY blobs/ /tests/blobs/
74
+ RUN chmod +x /tests/test.sh
patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_01.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c601808b3799bc34ef011a4fb3be01b495f1b6fd97c55490076e01223256268b
3
+ size 26210
patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_02.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94db8bc99b3e8a69058d14d89ba17e3337e749156972a5d0dcca2183998948be
3
+ size 26429
patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_03.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e2fa59aaaacbe489a140af9f984d81a47b175845b64e1f68ea77d9624739e29
3
+ size 22555
patwie--cppnumericalsolvers.14a9/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:391ce6377c2446bbeaefebf78355c2c60c86523821fbe76d77b9d1d6449b5367
3
+ size 24909
patwie--cppnumericalsolvers.14a9/tests/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
patwie--cppnumericalsolvers.14a9/tests/download.sh ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #
3
+ # download.sh — dependency prefetch for CppNumericalSolvers
4
+ #
5
+ # This script ONLY installs/prefetches the external build dependencies that
6
+ # build.sh needs to compile the 'simple' example. It does not compile, link,
7
+ # test, or package anything.
8
+ #
9
+ # It is designed to be SOURCED (source /source_ro/download.sh), not executed,
10
+ # so it keeps exported env vars in the current shell and never calls `exit` in
11
+ # normal control flow. On a hard failure it returns nonzero so the caller sees
12
+ # the failure.
13
+ #
14
+ # Dependencies (all from Ubuntu 22.04 apt, versions pinned by the distro):
15
+ # - libeigen3-dev : Eigen3 3.4.0 (header-only linear algebra; the ONLY
16
+ # runtime/library dependency of the repo)
17
+ # - libgtest-dev : GoogleTest 1.11.0 (required by src/examples/CMakeLists
18
+ # which does find_package(GTest REQUIRED)
19
+ # even when building only examples)
20
+ #
21
+ # All package names are written explicitly here; download.sh reads no
22
+ # repository files and requires no network beyond apt.
23
+
24
+ export DEBIAN_FRONTEND=noninteractive
25
+
26
+ echo "==> [download] refresh apt package index (needed because apt in the build image starts with an empty local index)"
27
+
28
+ if ! apt-get update; then
29
+ echo "[download] ERROR: apt-get update failed" >&2
30
+ return 1
31
+ fi
32
+
33
+ echo "==> [download] installing libeigen3-dev + libgtest-dev"
34
+
35
+ if ! apt-get install -y libeigen3-dev libgtest-dev; then
36
+ echo "[download] ERROR: apt-get install of Eigen3/GoogleTest failed" >&2
37
+ return 1
38
+ fi
39
+
40
+ echo "==> [download] complete: Eigen3 and GoogleTest are now available for build.sh"
patwie--cppnumericalsolvers.14a9/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84fa015c0570af8ef662fcd52f99b32f09b2f48b14c198e218a07d52899d2c5b
3
+ size 1189560
patwie--cppnumericalsolvers.14a9/tests/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
patwie--cppnumericalsolvers.14a9/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
patwie--cppnumericalsolvers.14a9/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
patwie--cppnumericalsolvers.14a9/tests/programgym_task.json ADDED
@@ -0,0 +1,808 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_01_objective_value.TestEvaluationOrder.test_start_value_exceeds_minimum_value",
9
+ "eval.tests.test_01_objective_value.TestEvaluationOrder.test_value_is_first_nonempty_line",
10
+ "eval.tests.test_01_objective_value.TestEvaluationOrder.test_value_line_has_no_label_prefix",
11
+ "eval.tests.test_01_objective_value.TestObjectiveValue.test_first_line_is_exact_objective",
12
+ "eval.tests.test_01_objective_value.TestObjectiveValue.test_objective_value_is_positive",
13
+ "eval.tests.test_01_objective_value.TestObjectiveValue.test_objective_value_is_within_quadratic_bounds",
14
+ "eval.tests.test_01_objective_value.TestObjectiveValue.test_objective_value_matches_weighted_square_formula",
15
+ "eval.tests.test_01_objective_value.TestObjectiveValue.test_objective_value_parses_to_expected_float",
16
+ "eval.tests.test_01_objective_value.TestValuePrecision.test_value_has_no_scientific_notation",
17
+ "eval.tests.test_01_objective_value.TestValuePrecision.test_value_is_a_plain_integer[905]",
18
+ "eval.tests.test_02_gradient_evaluation.TestGradientComponents.test_components_have_opposite_sign",
19
+ "eval.tests.test_02_gradient_evaluation.TestGradientComponents.test_first_component_is_negative_hand_value",
20
+ "eval.tests.test_02_gradient_evaluation.TestGradientComponents.test_first_component_matches_coordinate_scaling",
21
+ "eval.tests.test_02_gradient_evaluation.TestGradientComponents.test_second_component_is_positive_hand_value",
22
+ "eval.tests.test_02_gradient_evaluation.TestGradientComponents.test_second_component_magnitude_larger",
23
+ "eval.tests.test_02_gradient_evaluation.TestGradientComponents.test_second_component_matches_coordinate_scaling",
24
+ "eval.tests.test_02_gradient_evaluation.TestGradientFormatAndFlow.test_gradient_at_expected_line_positions",
25
+ "eval.tests.test_02_gradient_evaluation.TestGradientFormatAndFlow.test_gradient_components_are_nonzero_away_from_optimum",
26
+ "eval.tests.test_02_gradient_evaluation.TestGradientFormatAndFlow.test_gradient_lines_have_no_label",
27
+ "eval.tests.test_02_gradient_evaluation.TestGradientFormatAndFlow.test_gradient_precedes_verification_flags",
28
+ "eval.tests.test_03_finite_difference_gradient.TestDerivativeVerificationOrdering.test_gradient_check_before_hessian_check",
29
+ "eval.tests.test_03_finite_difference_gradient.TestGradientCorrectFlag.test_flag_is_true",
30
+ "eval.tests.test_03_finite_difference_gradient.TestGradientCorrectFlag.test_flag_token_is_binary_zero_or_one",
31
+ "eval.tests.test_03_finite_difference_gradient.TestGradientCorrectFlag.test_gradient_flag_opposes_hessian_flag",
32
+ "eval.tests.test_03_finite_difference_gradient.TestGradientFiniteDifferenceConsistency.test_finite_difference_recovers_constant_gradient",
33
+ "eval.tests.test_03_finite_difference_gradient.TestGradientFiniteDifferenceConsistency.test_flag_single_character_no_padding",
34
+ "eval.tests.test_03_finite_difference_gradient.TestGradientFiniteDifferenceConsistency.test_gradient_flag_is_printed_after_gradient",
35
+ "eval.tests.test_03_finite_difference_gradient.TestGradientFiniteDifferenceConsistency.test_raw_stdout_contains_finite_difference_result",
36
+ "eval.tests.test_04_finite_difference_hessian.TestHessianCorrectFlag.test_flag_is_false",
37
+ "eval.tests.test_04_finite_difference_hessian.TestHessianCorrectFlag.test_flag_occupies_fourth_line",
38
+ "eval.tests.test_04_finite_difference_hessian.TestHessianCorrectFlag.test_flag_token_is_binary",
39
+ "eval.tests.test_04_finite_difference_hessian.TestHessianFlagFormat.test_hessian_flag_is_bare_token",
40
+ "eval.tests.test_04_finite_difference_hessian.TestHessianFlagFormat.test_raw_output_contains_hessian_token",
41
+ "eval.tests.test_04_finite_difference_hessian.TestHessianStructuralBehavior.test_diagonal_hessian_coefficients_are_ten_and_two_hundred",
42
+ "eval.tests.test_04_finite_difference_hessian.TestHessianStructuralBehavior.test_hessian_condition_number_is_twenty",
43
+ "eval.tests.test_04_finite_difference_hessian.TestHessianStructuralBehavior.test_hessian_flag_printed_before_solver",
44
+ "eval.tests.test_05_initial_state.TestFunctionStateCoordinateHandling.test_initial_state_distinct_from_argmin",
45
+ "eval.tests.test_05_initial_state.TestFunctionStateCoordinateHandling.test_state_coordinates_value_to_original",
46
+ "eval.tests.test_05_initial_state.TestFunctionStateCoordinateHandling.test_state_x_matches_gradient_evaluation_point",
47
+ "eval.tests.test_05_initial_state.TestInitialStateLine.test_init_line_appears_once",
48
+ "eval.tests.test_05_initial_state.TestInitialStateLine.test_init_line_has_label",
49
+ "eval.tests.test_05_initial_state.TestInitialStateLine.test_init_line_precedes_first_iteration",
50
+ "eval.tests.test_05_initial_state.TestInitialStateLine.test_init_x0_equals_minus_ten",
51
+ "eval.tests.test_05_initial_state.TestInitialStateLine.test_init_x1_equals_two",
52
+ "eval.tests.test_06_lbfgs_minimization.TestArgminLocation.test_argmin_far_from_start",
53
+ "eval.tests.test_06_lbfgs_minimization.TestArgminLocation.test_argmin_has_label_token",
54
+ "eval.tests.test_06_lbfgs_minimization.TestArgminLocation.test_argmin_x0_is_near_origin",
55
+ "eval.tests.test_06_lbfgs_minimization.TestArgminLocation.test_argmin_x1_is_near_origin",
56
+ "eval.tests.test_06_lbfgs_minimization.TestArgminValue.test_argmin_value_between_four_and_six",
57
+ "eval.tests.test_06_lbfgs_minimization.TestArgminValue.test_argmin_value_is_five",
58
+ "eval.tests.test_06_lbfgs_minimization.TestArgminValue.test_argmin_value_is_lower_than_start_value",
59
+ "eval.tests.test_06_lbfgs_minimization.TestArgminValue.test_argmin_value_is_positive",
60
+ "eval.tests.test_06_lbfgs_minimization.TestConvergenceStatus.test_status_line_has_label",
61
+ "eval.tests.test_06_lbfgs_minimization.TestConvergenceStatus.test_status_mentions_gradient_norm",
62
+ "eval.tests.test_06_lbfgs_minimization.TestConvergenceStatus.test_status_reports_gradient_norm_convergence",
63
+ "eval.tests.test_06_lbfgs_minimization.TestIterationCount.test_iteration_count_consistent_with_blocks",
64
+ "eval.tests.test_06_lbfgs_minimization.TestIterationCount.test_iteration_count_fixed_at_two",
65
+ "eval.tests.test_06_lbfgs_minimization.TestIterationCount.test_iteration_count_is_positive",
66
+ "eval.tests.test_06_lbfgs_minimization.TestSummaryBlockLayout.test_no_output_after_status",
67
+ "eval.tests.test_06_lbfgs_minimization.TestSummaryBlockLayout.test_summary_lines_in_order",
68
+ "eval.tests.test_07_iteration_progress.TestBlockCount.test_block_count_equals_reported_iterations",
69
+ "eval.tests.test_07_iteration_progress.TestBlockCount.test_exactly_three_blocks",
70
+ "eval.tests.test_07_iteration_progress.TestBlockFields.test_block_has_all_seven_fields[0]",
71
+ "eval.tests.test_07_iteration_progress.TestBlockFields.test_block_has_all_seven_fields[1]",
72
+ "eval.tests.test_07_iteration_progress.TestBlockFields.test_block_has_all_seven_fields[2]",
73
+ "eval.tests.test_07_iteration_progress.TestBlockFields.test_value_field_parses_as_float[0]",
74
+ "eval.tests.test_07_iteration_progress.TestBlockFields.test_value_field_parses_as_float[1]",
75
+ "eval.tests.test_07_iteration_progress.TestBlockFields.test_value_field_parses_as_float[2]",
76
+ "eval.tests.test_07_iteration_progress.TestBlockHeaderFormat.test_exactly_three_dashed_separators",
77
+ "eval.tests.test_07_iteration_progress.TestBlockHeaderFormat.test_headers_are_labeled_with_incrementing_index",
78
+ "eval.tests.test_07_iteration_progress.TestBlockValues.test_block0_value_is_start_value",
79
+ "eval.tests.test_07_iteration_progress.TestBlockValues.test_block1_value_is_known",
80
+ "eval.tests.test_07_iteration_progress.TestBlockValues.test_block2_value_is_the_minimum",
81
+ "eval.tests.test_07_iteration_progress.TestBlockValues.test_hessian_cond_is_twenty_for_later_blocks",
82
+ "eval.tests.test_07_iteration_progress.TestBlockZeroInitialization.test_initial_block_has_zero_deltas_and_condition",
83
+ "eval.tests.test_07_iteration_progress.TestDescentMonotonicity.test_objective_decreases_between_blocks[0-1]",
84
+ "eval.tests.test_07_iteration_progress.TestDescentMonotonicity.test_objective_decreases_between_blocks[1-2]",
85
+ "eval.tests.test_07_iteration_progress.TestGradientNormPerBlock.test_final_block_gradient_norm_converged",
86
+ "eval.tests.test_07_iteration_progress.TestGradientNormPerBlock.test_gradient_norm_grows_then_collapses",
87
+ "eval.tests.test_07_iteration_progress.TestGradientNormPerBlock.test_start_block_gradient_norm_is_zero",
88
+ "eval.tests.test_07_iteration_progress.TestXFidelity.test_final_x_is_near_origin",
89
+ "eval.tests.test_07_iteration_progress.TestXFidelity.test_start_x_matches_initial_state",
90
+ "eval.tests.test_07_iteration_progress.TestXFidelity.test_x_distance_shrinks_over_blocks",
91
+ "eval.tests.test_08_output_structure.TestDocumentShape.test_contains_labeled_header_primitives",
92
+ "eval.tests.test_08_output_structure.TestDocumentShape.test_document_is_multisection",
93
+ "eval.tests.test_08_output_structure.TestDocumentShape.test_has_expected_number_of_nonempty_lines",
94
+ "eval.tests.test_08_output_structure.TestExitStatus.test_exit_zero_with_full_solver_output",
95
+ "eval.tests.test_08_output_structure.TestExitStatus.test_stderr_empty_while_stdout_carries_result",
96
+ "eval.tests.test_08_output_structure.TestExitStatus.test_stdout_is_longer_than_preamble",
97
+ "eval.tests.test_08_output_structure.TestSectionOrdering.test_solver_summary_after_iterations",
98
+ "eval.tests.test_08_output_structure.TestSectionOrdering.test_value_gradient_flags_then_init",
99
+ "eval.tests.test_08_output_structure.test_output_independent_of_arguments[extra_args0]",
100
+ "eval.tests.test_08_output_structure.test_output_independent_of_arguments[extra_args1]",
101
+ "eval.tests.test_08_output_structure.test_output_independent_of_arguments[extra_args2]",
102
+ "eval.tests.test_08_output_structure.test_output_is_byte_identical_across_runs[2]",
103
+ "eval.tests.test_08_output_structure.test_output_is_byte_identical_across_runs[3]",
104
+ "eval.tests.test_09_cross_field_consistency.TestArgminConsistency.test_argmin_has_near_zero_gradient",
105
+ "eval.tests.test_09_cross_field_consistency.TestArgminConsistency.test_argmin_matches_final_block_x",
106
+ "eval.tests.test_09_cross_field_consistency.TestArgminConsistency.test_argmin_value_matches_final_value",
107
+ "eval.tests.test_09_cross_field_consistency.TestFDeltaConservation.test_f_delta_equals_previous_minus_current_value[1]",
108
+ "eval.tests.test_09_cross_field_consistency.TestFDeltaConservation.test_f_delta_equals_previous_minus_current_value[2]",
109
+ "eval.tests.test_09_cross_field_consistency.TestFDeltaConservation.test_start_block_f_delta_is_zero",
110
+ "eval.tests.test_09_cross_field_consistency.TestGradientHessianRelation.test_gradient_block1_matches_diag_times_x",
111
+ "eval.tests.test_09_cross_field_consistency.TestGradientHessianRelation.test_x_delta_first_block_matches_descent_step",
112
+ "eval.tests.test_09_cross_field_consistency.TestGradientNormConsistency.test_gradient_norm_matches_gradient_vector[1]",
113
+ "eval.tests.test_09_cross_field_consistency.TestGradientNormConsistency.test_gradient_norm_matches_gradient_vector[2]",
114
+ "eval.tests.test_09_cross_field_consistency.TestHessianConditionNumber.test_condition_number_ratio",
115
+ "eval.tests.test_09_cross_field_consistency.TestHessianConditionNumber.test_diagonal_entries_from_gradient_scaling",
116
+ "eval.tests.test_10_golden_full_output.TestExactFullOutput.test_stdout_digest_matches_golden_digest",
117
+ "eval.tests.test_10_golden_full_output.TestExactFullOutput.test_stdout_matches_golden_bytes",
118
+ "eval.tests.test_10_golden_full_output.TestGoldenNormalizedEquality.test_line_count_matches_golden",
119
+ "eval.tests.test_10_golden_full_output.TestGoldenNormalizedEquality.test_normalized_lines_equal_golden",
120
+ "eval.tests.test_10_golden_full_output.TestGoldenSelfConsistency.test_golden_first_line_is_objective",
121
+ "eval.tests.test_10_golden_full_output.TestGoldenSelfConsistency.test_golden_has_value_and_verification_flags",
122
+ "eval.tests.test_10_golden_full_output.TestGoldenSelfConsistency.test_golden_summary_block_present",
123
+ "eval.tests.test_10_golden_full_output.TestStableFullDocument.test_final_golden_does_not_change_across_runs",
124
+ "eval.tests.test_10_golden_full_output.TestStableFullDocument.test_live_document_sha_length",
125
+ "eval.tests.test_10_golden_full_output.TestStableFullDocument.test_normalized_stream_digest_matches_golden_lines_digest",
126
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestGradientOracleIsDiscriminating.test_large_error_fails_and_small_passes",
127
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestGradientOracleIsDiscriminating.test_wrong_gradient_fails_verification_for_printed_point",
128
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component0[0]",
129
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component0[1]",
130
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component0[2]",
131
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component0[3]",
132
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component1[0]",
133
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component1[1]",
134
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component1[2]",
135
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIndependentGradientStencils.test_stencil_recovers_printed_gradient_component1[3]",
136
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIsGradientCorrectWarrant.test_accuracy3_verdict_matches_stdout_flag",
137
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIsGradientCorrectWarrant.test_all_accuracies_pass_against_printed_gradient",
138
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestIsGradientCorrectWarrant.test_stdout_flag_consistent_with_analytic_gradient",
139
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestStepSizeSemantics.test_high_order_stencil_has_more_terms",
140
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestStepSizeSemantics.test_step0_uses_coordinate_magnitude_at_printed_point",
141
+ "eval.tests.test_11_finite_difference_gradient_oracle.TestStepSizeSemantics.test_step_positive_for_negative_coordinates",
142
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestAnalyticHessianReflectedInOutput.test_diagonal_ratio_matches_printed_condition_number",
143
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestAnalyticHessianReflectedInOutput.test_first_block_condition_number_is_zero",
144
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestAnalyticHessianReflectedInOutput.test_mixed_partial_is_zero_and_match_flag",
145
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestFiniteDifferenceDiagonalDriftConsequence.test_diagonal_approx_00_drifts_from_ten_at_printed_point",
146
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestFiniteDifferenceDiagonalDriftConsequence.test_diagonal_approx_11_drifts_near_256",
147
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestIsHessianCorrectWarrant.test_diagonal_check_rejects_large_drift",
148
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestIsHessianCorrectWarrant.test_tolerance_boundary_discriminates",
149
+ "eval.tests.test_12_finite_difference_hessian_oracle.TestIsHessianCorrectWarrant.test_verdict_matches_stdout_flag",
150
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_across_argument_tails[dashes-args]",
151
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_across_argument_tails[help-flag]",
152
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_across_argument_tails[huge-arg]",
153
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_across_argument_tails[numeric-args]",
154
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_across_argument_tails[version-flag]",
155
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_for_flag_like_and_unicode_argv[double-dash-positionals]",
156
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_for_flag_like_and_unicode_argv[equals-flag]",
157
+ "eval.tests.test_13_executable_robustness.TestArgumentRobustness.test_output_identical_for_flag_like_and_unicode_argv[unicode-args]",
158
+ "eval.tests.test_13_executable_robustness.TestEnvironmentIndependence.test_output_identical_across_locales[c-locale]",
159
+ "eval.tests.test_13_executable_robustness.TestEnvironmentIndependence.test_output_identical_across_locales[de-numeric]",
160
+ "eval.tests.test_13_executable_robustness.TestEnvironmentIndependence.test_output_identical_across_locales[utf8-locale]",
161
+ "eval.tests.test_13_executable_robustness.TestEnvironmentIndependence.test_output_identical_with_forced_latin1_and_terms",
162
+ "eval.tests.test_13_executable_robustness.TestStdInIndependence.test_output_identical_when_stdin_is_piped_text",
163
+ "eval.tests.test_13_executable_robustness.TestWorkingDirectoryIndependence.test_output_identical_from_isolated_tmp_cwd",
164
+ "eval.tests.test_14_output_formatting.TestBareResultTokens.test_gradient_lines_are_bare_numbers",
165
+ "eval.tests.test_14_output_formatting.TestBareResultTokens.test_objective_value_is_unlabeled_int",
166
+ "eval.tests.test_14_output_formatting.TestBareResultTokens.test_verification_flags_are_single_digits",
167
+ "eval.tests.test_14_output_formatting.TestBlockSeparators.test_exactly_three_25_dash_separators",
168
+ "eval.tests.test_14_output_formatting.TestBlockSeparators.test_summary_follows_final_separator",
169
+ "eval.tests.test_14_output_formatting.TestEigenColumnAlignment.test_init_row_uses_eigen_double_space_for_positive_col",
170
+ "eval.tests.test_14_output_formatting.TestEigenColumnAlignment.test_second_gradient_column_is_space_padded",
171
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_field_line_contains_exact_fragment[block0-value]",
172
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_field_line_contains_exact_fragment[block1-gradnorm]",
173
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_field_line_contains_exact_fragment[block1-hesscond]",
174
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_field_line_contains_exact_fragment[block2-fdelta]",
175
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_hessian_condition_is_twenty_point_zero_five",
176
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_summary_row_is_exact_line[argmin-line]",
177
+ "eval.tests.test_14_output_formatting.TestNumericFieldFormatting.test_summary_row_is_exact_line[fargmin-line]",
178
+ "eval.tests.test_14_output_formatting.TestScientificNotationRows.test_block2_gradient_uses_scientific_notation",
179
+ "eval.tests.test_14_output_formatting.TestScientificNotationRows.test_block2_x_uses_scientific_notation",
180
+ "eval.tests.test_14_output_formatting.TestStderrAndExitContract.test_full_success_has_no_stderr",
181
+ "eval.tests.test_15_step_geometric_invariants.TestDescentDirection.test_block1_step_is_a_descent_direction",
182
+ "eval.tests.test_15_step_geometric_invariants.TestFinalStepXDeltaConservation.test_block2_x_delta_matches_printed_x_vectors",
183
+ "eval.tests.test_15_step_geometric_invariants.TestPlainNotationFormattingBoundary.test_block0_x_row_is_exact_plain_integer_row",
184
+ "eval.tests.test_15_step_geometric_invariants.TestPlainNotationFormattingBoundary.test_block1_x_row_is_exact_plain_row",
185
+ "eval.tests.test_15_step_geometric_invariants.TestPlainNotationFormattingBoundary.test_plain_rows_precede_scientific_row",
186
+ "eval.tests.test_15_step_geometric_invariants.TestTopGradientMatchesInitialState.test_block0_gradient_echoes_top_gradient",
187
+ "eval.tests.test_15_step_geometric_invariants.TestTopGradientMatchesInitialState.test_top_gradient_equals_diag_times_initial_x",
188
+ "eval.tests.test_16_analytic_objective_rederivation.TestGradientRedervesDiagonalTimesX.test_gradient_equals_diag_times_x_every_block[converged-block]",
189
+ "eval.tests.test_16_analytic_objective_rederivation.TestGradientRedervesDiagonalTimesX.test_gradient_equals_diag_times_x_every_block[descent-block]",
190
+ "eval.tests.test_16_analytic_objective_rederivation.TestGradientRedervesDiagonalTimesX.test_gradient_equals_diag_times_x_every_block[start-block]",
191
+ "eval.tests.test_16_analytic_objective_rederivation.TestMonotoneConvergenceToMinimum.test_rederived_objective_is_strictly_decreasing",
192
+ "eval.tests.test_16_analytic_objective_rederivation.TestMonotoneConvergenceToMinimum.test_start_quadratic_dominates_constant",
193
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveLowerBound.test_converged_value_equals_constant_term",
194
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveLowerBound.test_every_printed_value_at_least_constant_term[block0]",
195
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveLowerBound.test_every_printed_value_at_least_constant_term[block1]",
196
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveLowerBound.test_every_printed_value_at_least_constant_term[block2]",
197
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveRedervesPrintedValue.test_f_at_printed_x_equals_printed_value[converged-block]",
198
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveRedervesPrintedValue.test_f_at_printed_x_equals_printed_value[descent-block]",
199
+ "eval.tests.test_16_analytic_objective_rederivation.TestObjectiveRedervesPrintedValue.test_f_at_printed_x_equals_printed_value[start-block]"
200
+ ]
201
+ },
202
+ "generated_module_02": {
203
+ "ignore_reason": "",
204
+ "ignored": false,
205
+ "ignored_tests": [
206
+ {
207
+ "name": "eval.tests.test_stream_termination.TestOutputByteLength.test_total_stdout_is_exactly_1010_bytes",
208
+ "reasons": [
209
+ {
210
+ "id": "golden_docstring",
211
+ "message": "pytest test docstring mentions golden data that is not used in the body",
212
+ "path": "eval/tests/test_stream_termination.py",
213
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
214
+ "severity": "error",
215
+ "stage": "static_lint"
216
+ },
217
+ {
218
+ "id": "golden_no_equality",
219
+ "message": "pytest test references golden data without equality comparison",
220
+ "path": "eval/tests/test_stream_termination.py",
221
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
222
+ "severity": "error",
223
+ "stage": "static_lint"
224
+ }
225
+ ]
226
+ }
227
+ ],
228
+ "tests": [
229
+ "eval.tests.test_analytic_objective.TestFirstOrderOptimality.test_argmin_is_stationary",
230
+ "eval.tests.test_analytic_objective.TestFirstOrderOptimality.test_convergence_satisfies_relative_gradient_norm_test",
231
+ "eval.tests.test_analytic_objective.TestGradientMatchesAnalytic.test_gradient_row_equals_analytic_gradient_at_each_x",
232
+ "eval.tests.test_analytic_objective.TestGradientMatchesAnalytic.test_initial_gradient_is_exact",
233
+ "eval.tests.test_analytic_objective.TestHessianConditionSemantics.test_hessian_condition_is_zero_before_first_update",
234
+ "eval.tests.test_analytic_objective.TestHessianConditionSemantics.test_hessian_condition_matches_analytic_diagonal",
235
+ "eval.tests.test_analytic_objective.TestObjectiveMatchesAnalytic.test_converged_value_is_analytic_minimum",
236
+ "eval.tests.test_analytic_objective.TestObjectiveMatchesAnalytic.test_initial_value_matches_starting_point",
237
+ "eval.tests.test_analytic_objective.TestObjectiveMatchesAnalytic.test_value_row_equals_analytic_objective_at_its_x",
238
+ "eval.tests.test_delta_invariants.TestDeltaInvariants.test_deltas_monotonic_consistency_with_values",
239
+ "eval.tests.test_delta_invariants.TestDeltaInvariants.test_f_delta_first_block_is_zero",
240
+ "eval.tests.test_delta_invariants.TestDeltaInvariants.test_f_delta_first_step",
241
+ "eval.tests.test_delta_invariants.TestDeltaInvariants.test_f_delta_second_step",
242
+ "eval.tests.test_delta_invariants.TestDeltaInvariants.test_x_delta_first_block_is_zero",
243
+ "eval.tests.test_delta_invariants.TestDeltaInvariants.test_x_delta_first_step",
244
+ "eval.tests.test_exact_step_values.TestFirstStepExactValues.test_block1_f_delta_exact",
245
+ "eval.tests.test_exact_step_values.TestFirstStepExactValues.test_block1_gradient_norm_exact",
246
+ "eval.tests.test_exact_step_values.TestFirstStepExactValues.test_block1_gradient_row_exact",
247
+ "eval.tests.test_exact_step_values.TestFirstStepExactValues.test_block1_hessian_condition_exact",
248
+ "eval.tests.test_exact_step_values.TestFirstStepExactValues.test_block1_x_delta_exact",
249
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_f_delta_exact",
250
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_gradient_norm_exact",
251
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_gradient_row_exact_scientific",
252
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_hessian_condition_exact",
253
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_value_row_exact",
254
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_x_delta_exact",
255
+ "eval.tests.test_exact_step_values.TestSecondStepExactValues.test_block2_x_row_exact_scientific",
256
+ "eval.tests.test_golden_full.test_golden_is_nonempty_and_binary_reproduces_it",
257
+ "eval.tests.test_golden_full.test_stderr_matches_full_golden",
258
+ "eval.tests.test_golden_full.test_stdout_matches_full_golden",
259
+ "eval.tests.test_gradient_semantics.TestReportedGradientMatchesAnalytic.test_gradient_after_first_step",
260
+ "eval.tests.test_gradient_semantics.TestReportedGradientMatchesAnalytic.test_gradient_after_second_step",
261
+ "eval.tests.test_gradient_semantics.TestReportedGradientMatchesAnalytic.test_gradient_and_x_rows_coexist_in_every_block",
262
+ "eval.tests.test_gradient_semantics.TestReportedGradientMatchesAnalytic.test_gradient_at_initial_point",
263
+ "eval.tests.test_initial_evaluation.TestFiniteDifferenceChecks.test_gradient_check_reports_correct",
264
+ "eval.tests.test_initial_evaluation.TestFiniteDifferenceChecks.test_hessian_check_reports_incorrect",
265
+ "eval.tests.test_initial_evaluation.TestGradientReport.test_gradient_x_component",
266
+ "eval.tests.test_initial_evaluation.TestGradientReport.test_gradient_y_component",
267
+ "eval.tests.test_initial_evaluation.TestInitialStateLine.test_init_line_appears_after_checks",
268
+ "eval.tests.test_initial_evaluation.TestInitialStateLine.test_init_line_reports_starting_point",
269
+ "eval.tests.test_initial_evaluation.TestObjectiveValue.test_value_line_is_905",
270
+ "eval.tests.test_initial_evaluation.TestObjectiveValue.test_value_precedes_solver_trace",
271
+ "eval.tests.test_invocation_isolation.TestEnvironmentIndependence.test_cleared_environment_does_not_change_output",
272
+ "eval.tests.test_invocation_isolation.TestEnvironmentIndependence.test_cwd_and_env_together_leave_output_unchanged",
273
+ "eval.tests.test_invocation_isolation.TestEnvironmentIndependence.test_injected_env_var_does_not_change_output",
274
+ "eval.tests.test_invocation_isolation.TestWorkingDirectoryIndependence.test_output_is_identical_across_repeated_isolated_dirs",
275
+ "eval.tests.test_invocation_isolation.TestWorkingDirectoryIndependence.test_output_is_identical_from_a_different_cwd",
276
+ "eval.tests.test_layout_invariants.TestFullTraceDimensions.test_summary_is_exactly_the_last_four_lines",
277
+ "eval.tests.test_layout_invariants.TestFullTraceDimensions.test_total_output_is_exactly_37_lines",
278
+ "eval.tests.test_layout_invariants.TestFullTraceDimensions.test_trace_has_no_blank_lines",
279
+ "eval.tests.test_layout_invariants.TestHeaderBlockGolden.test_header_block_matches_canonical_sequence_exactly",
280
+ "eval.tests.test_layout_invariants.TestHeaderBlockGolden.test_init_line_preserves_two_space_transpose_separator",
281
+ "eval.tests.test_layout_invariants.TestHeaderBlockGolden.test_positive_gradient_component_is_sign_padded",
282
+ "eval.tests.test_layout_invariants.TestHessianConditionColumn.test_hessian_condition_decimal_sits_at_column_14",
283
+ "eval.tests.test_layout_invariants.TestHessianConditionColumn.test_other_scalar_rows_decimal_at_column_26",
284
+ "eval.tests.test_layout_invariants.TestObjectiveResidualAtArgmin.test_gradient_residual_at_printed_argmin_is_vanishing",
285
+ "eval.tests.test_layout_invariants.TestObjectiveResidualAtArgmin.test_objective_at_printed_argmin_is_analytic_minimum",
286
+ "eval.tests.test_layout_invariants.TestPhasingBoundaries.test_header_block_occupies_lines_zero_through_five",
287
+ "eval.tests.test_layout_invariants.TestPhasingBoundaries.test_last_ruler_is_followed_by_summary_not_a_fourth_block",
288
+ "eval.tests.test_layout_invariants.TestPhasingBoundaries.test_ruler_of_last_block_directly_precedes_argmin",
289
+ "eval.tests.test_layout_invariants.TestPrecisionContrast.test_header_value_equals_first_progress_value",
290
+ "eval.tests.test_layout_invariants.TestPrecisionContrast.test_no_fixed_point_suffix_in_header",
291
+ "eval.tests.test_layout_invariants.TestPrecisionContrast.test_objective_header_uses_default_integer_format",
292
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_each_scalar_label_contributes_exactly_three_rows",
293
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_every_scalar_value_ends_at_column_32",
294
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_scalar_number_is_right_aligned_field[F Delta:]",
295
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_scalar_number_is_right_aligned_field[Gradient Norm:]",
296
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_scalar_number_is_right_aligned_field[Hessian Cond.:]",
297
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_scalar_number_is_right_aligned_field[Value:]",
298
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_scalar_number_is_right_aligned_field[X Delta:]",
299
+ "eval.tests.test_layout_invariants.TestScalarColumnAlignment.test_scalar_row_total_width_is_uniform",
300
+ "eval.tests.test_layout_invariants.TestValueDecimalColumn.test_two_digits_before_decimal_shift_value_still_ends_at_32",
301
+ "eval.tests.test_layout_invariants.TestValueDecimalColumn.test_value_decimal_point_is_at_column_26",
302
+ "eval.tests.test_numeric_layout.TestFixedWidthScalarRows.test_all_scalar_rows_are_two_space_indented",
303
+ "eval.tests.test_numeric_layout.TestFixedWidthScalarRows.test_every_scalar_row_right_aligns_six_decimal_number",
304
+ "eval.tests.test_numeric_layout.TestRowCountBalance.test_each_field_row_appears_exactly_once_per_block",
305
+ "eval.tests.test_numeric_layout.TestRowCountBalance.test_field_order_within_each_block_is_constant",
306
+ "eval.tests.test_numeric_layout.TestVectorRowFormatting.test_vector_rows_are_two_space_indented",
307
+ "eval.tests.test_numeric_layout.TestVectorRowFormatting.test_vector_rows_use_default_variable_precision",
308
+ "eval.tests.test_program_contract.TestExitContract.test_exit_code_zero_on_default_run",
309
+ "eval.tests.test_program_contract.TestExitContract.test_stderr_is_empty",
310
+ "eval.tests.test_program_contract.TestExitContract.test_stdout_starts_with_objective_and_gradient",
311
+ "eval.tests.test_program_contract.TestExitContract.test_stdout_stderr_are_separate_streams",
312
+ "eval.tests.test_program_contract.TestInvocationRobustness.test_help_argument_does_not_crash",
313
+ "eval.tests.test_program_contract.TestInvocationRobustness.test_piped_stdin_is_ignored",
314
+ "eval.tests.test_program_contract.TestInvocationRobustness.test_repeated_invocations_are_deterministic",
315
+ "eval.tests.test_progress_reporting.TestBlockStructure.test_exactly_three_progress_blocks",
316
+ "eval.tests.test_progress_reporting.TestBlockStructure.test_iteration_index_is_zero_padded_to_width_5",
317
+ "eval.tests.test_progress_reporting.TestBlockStructure.test_iteration_numbers_are_consecutive",
318
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_final_block_reaches_objective_floor",
319
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_final_block_x_approaches_zero",
320
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_first_block_reports_zero_deltas",
321
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_gradient_norm_reported_in_each_block",
322
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_hessian_condition_is_reported",
323
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_objective_strictly_decreases_across_blocks",
324
+ "eval.tests.test_progress_reporting.TestConvergenceMonitor.test_second_block_shows_one_step_taken",
325
+ "eval.tests.test_progress_reporting.TestNumericFormatting.test_value_field_is_width_padded",
326
+ "eval.tests.test_progress_reporting.TestNumericFormatting.test_value_uses_fixed_six_decimals",
327
+ "eval.tests.test_progress_reporting.TestPerBlockLabels.test_every_block_contains_all_expected_labels",
328
+ "eval.tests.test_progress_reporting.TestPerBlockLabels.test_label_lines_are_two_space_indented",
329
+ "eval.tests.test_solver_result.TestArgmin.test_argmin_is_origin",
330
+ "eval.tests.test_solver_result.TestArgmin.test_argmin_precedes_objective_summary",
331
+ "eval.tests.test_solver_result.TestIterationCount.test_iteration_count_field_has_label",
332
+ "eval.tests.test_solver_result.TestIterationCount.test_iterations_equals_two",
333
+ "eval.tests.test_solver_result.TestObjectiveAtArgmin.test_f_in_argmin_equals_last_reported_block_value",
334
+ "eval.tests.test_solver_result.TestObjectiveAtArgmin.test_f_in_argmin_is_five",
335
+ "eval.tests.test_solver_result.TestStatusString.test_status_is_the_last_line",
336
+ "eval.tests.test_solver_result.TestStatusString.test_status_mentions_gradient_and_norm",
337
+ "eval.tests.test_solver_result.TestStatusString.test_status_reports_gradient_norm_violation",
338
+ "eval.tests.test_solver_result.TestStatusWhitelist.test_status_is_a_known_enum_value",
339
+ "eval.tests.test_solver_result.TestStatusWhitelist.test_status_is_not_other_termination_messages",
340
+ "eval.tests.test_step_accounting.TestIterationAccounting.test_each_post_step_block_carries_its_own_iteration_index",
341
+ "eval.tests.test_step_accounting.TestIterationAccounting.test_iterations_equals_post_step_block_count",
342
+ "eval.tests.test_step_accounting.TestIterationAccounting.test_pre_step_block_carries_iteration_zero",
343
+ "eval.tests.test_step_accounting.TestStepDescriptor.test_step_count_matches_status_and_blocks",
344
+ "eval.tests.test_step_accounting.TestStepMovement.test_each_step_reduces_the_objective",
345
+ "eval.tests.test_step_accounting.TestStepMovement.test_f_delta_equals_value_change_each_step",
346
+ "eval.tests.test_step_accounting.TestStepMovement.test_first_step_is_the_larger_movement",
347
+ "eval.tests.test_step_accounting.TestStepMovement.test_x_delta_equals_parameter_motion_each_step",
348
+ "eval.tests.test_stream_termination.TestLineEndings.test_no_carriage_returns_in_output",
349
+ "eval.tests.test_stream_termination.TestLineEndings.test_output_terminates_with_exactly_one_newline",
350
+ "eval.tests.test_stream_termination.TestOutputByteLength.test_stderr_is_exactly_zero_bytes",
351
+ "eval.tests.test_stream_termination.TestOutputByteLength.test_total_stdout_is_exactly_1010_bytes",
352
+ "eval.tests.test_stream_termination.TestTrailingWhitespace.test_no_blank_or_whitespace_only_line_between_blocks",
353
+ "eval.tests.test_stream_termination.TestTrailingWhitespace.test_no_trailing_whitespace_on_any_line",
354
+ "eval.tests.test_summary_format.TestSummaryConsistency.test_argmin_coincides_with_final_block_x",
355
+ "eval.tests.test_summary_format.TestSummaryConsistency.test_f_in_argmin_equals_final_progress_value",
356
+ "eval.tests.test_summary_format.TestSummaryConsistency.test_iterations_is_a_nonnegative_decimal",
357
+ "eval.tests.test_summary_format.TestSummaryFieldFormat.test_argmin_uses_fixed_six_decimals",
358
+ "eval.tests.test_summary_format.TestSummaryFieldFormat.test_f_in_argmin_uses_fixed_six_decimals",
359
+ "eval.tests.test_summary_format.TestSummaryFieldFormat.test_summary_field_order_is_fixed",
360
+ "eval.tests.test_trace_structure.TestHessianConditionBranch.test_hessian_condition_matches_block",
361
+ "eval.tests.test_trace_structure.TestHessianConditionBranch.test_hessian_condition_never_na",
362
+ "eval.tests.test_trace_structure.TestLabelCardinality.test_each_row_label_occurs_once_per_block",
363
+ "eval.tests.test_trace_structure.TestLabelCardinality.test_gradient_row_present_in_every_block",
364
+ "eval.tests.test_trace_structure.TestTraceGlobalShape.test_each_block_is_nine_lines",
365
+ "eval.tests.test_trace_structure.TestTraceGlobalShape.test_header_label_appears_three_times",
366
+ "eval.tests.test_trace_structure.TestTraceGlobalShape.test_one_ruler_per_iteration",
367
+ "eval.tests.test_trace_structure.TestWithinBlockOrdering.test_labels_follow_fixed_order_within_each_block"
368
+ ]
369
+ },
370
+ "generated_module_03": {
371
+ "ignore_reason": "",
372
+ "ignored": false,
373
+ "ignored_tests": [],
374
+ "tests": [
375
+ "eval.tests.test_binary_relocation_and_side_effects.test_binary_does_not_read_own_source_tree",
376
+ "eval.tests.test_binary_relocation_and_side_effects.test_binary_is_relocatable",
377
+ "eval.tests.test_binary_relocation_and_side_effects.test_binary_is_rename_tolerant",
378
+ "eval.tests.test_binary_relocation_and_side_effects.test_binary_paths_with_spaces_and_unicode",
379
+ "eval.tests.test_binary_relocation_and_side_effects.test_run_creates_no_root_adjacent_files",
380
+ "eval.tests.test_binary_relocation_and_side_effects.test_run_leaves_no_files_in_working_directory",
381
+ "eval.tests.test_binary_relocation_and_side_effects.test_trailing_newline_and_bytes_appear_default",
382
+ "eval.tests.test_determinism_and_robustness.test_arg_variants_do_not_change_output",
383
+ "eval.tests.test_determinism_and_robustness.test_binary_accepts_repeated_same_arg",
384
+ "eval.tests.test_determinism_and_robustness.test_executable_resolves_via_env_var",
385
+ "eval.tests.test_determinism_and_robustness.test_full_stream_hash_is_constant_across_samples",
386
+ "eval.tests.test_determinism_and_robustness.test_nonzero_argv_does_not_write_stderr",
387
+ "eval.tests.test_determinism_and_robustness.test_repeated_runs_bytes_identical[0]",
388
+ "eval.tests.test_determinism_and_robustness.test_repeated_runs_bytes_identical[1]",
389
+ "eval.tests.test_determinism_and_robustness.test_repeated_runs_bytes_identical[2]",
390
+ "eval.tests.test_determinism_and_robustness.test_repeated_runs_bytes_identical[3]",
391
+ "eval.tests.test_determinism_and_robustness.test_repeated_runs_bytes_identical[4]",
392
+ "eval.tests.test_determinism_and_robustness.test_stdout_len_is_stable",
393
+ "eval.tests.test_document_geometry.test_argmin_matches_final_block_x",
394
+ "eval.tests.test_document_geometry.test_field_order_is_constant_across_blocks",
395
+ "eval.tests.test_document_geometry.test_final_value_cross_matches_trailer",
396
+ "eval.tests.test_document_geometry.test_init_line_exact_spacing",
397
+ "eval.tests.test_document_geometry.test_iterations_equals_blocks_minus_one",
398
+ "eval.tests.test_document_geometry.test_label_column_geometry_identical_across_blocks",
399
+ "eval.tests.test_document_geometry.test_trailer_iterations_equals_last_block_number",
400
+ "eval.tests.test_document_geometry.test_value_left_padding_varies_but_right_edge_fixed",
401
+ "eval.tests.test_execution_paths.test_binary_invoked_by_relative_path",
402
+ "eval.tests.test_execution_paths.test_repeated_file_redirect_runs_are_byte_identical",
403
+ "eval.tests.test_execution_paths.test_runs_from_readonly_working_directory",
404
+ "eval.tests.test_formatting.test_canonical_label_row_spacing",
405
+ "eval.tests.test_formatting.test_eventual_value_is_constant_term",
406
+ "eval.tests.test_formatting.test_gradient_norm_field_is_6_decimal_general",
407
+ "eval.tests.test_formatting.test_gradient_row_has_two_components",
408
+ "eval.tests.test_formatting.test_iteration_header_right_aligned_width",
409
+ "eval.tests.test_formatting.test_iteration_zero_reports_zero_deltas",
410
+ "eval.tests.test_formatting.test_separator_dash_count",
411
+ "eval.tests.test_formatting.test_value_field_is_6_decimal_fixed",
412
+ "eval.tests.test_formatting.test_value_rows_all_present",
413
+ "eval.tests.test_formatting.test_x_row_has_two_components",
414
+ "eval.tests.test_io_isolation_robustness.test_argv_edge_cases_are_ignored[control_and_high_bytes_arg]",
415
+ "eval.tests.test_io_isolation_robustness.test_argv_edge_cases_are_ignored[eight_same_args]",
416
+ "eval.tests.test_io_isolation_robustness.test_argv_edge_cases_are_ignored[empty_string_arg]",
417
+ "eval.tests.test_io_isolation_robustness.test_argv_edge_cases_are_ignored[two_thousand_numeric_args]",
418
+ "eval.tests.test_io_isolation_robustness.test_argv_edge_cases_are_ignored[very_long_single_arg]",
419
+ "eval.tests.test_io_isolation_robustness.test_concurrent_invocations_are_byte_identical",
420
+ "eval.tests.test_io_isolation_robustness.test_concurrent_stdout_length_and_hash_stable",
421
+ "eval.tests.test_io_isolation_robustness.test_full_output_is_exactly_37_lines",
422
+ "eval.tests.test_io_isolation_robustness.test_golden_stdout_is_37_lines_and_ascii",
423
+ "eval.tests.test_io_isolation_robustness.test_multiple_locale_env_vars_all_consistent",
424
+ "eval.tests.test_io_isolation_robustness.test_no_environment_variables_required",
425
+ "eval.tests.test_io_isolation_robustness.test_output_charset_is_ascii_only",
426
+ "eval.tests.test_io_isolation_robustness.test_output_invariant_to_locale[C.utf8]",
427
+ "eval.tests.test_io_isolation_robustness.test_output_invariant_to_locale[C]",
428
+ "eval.tests.test_io_isolation_robustness.test_preamble_layout_is_exactly_five_lines",
429
+ "eval.tests.test_io_isolation_robustness.test_stdin_is_ignored_large_random_payload",
430
+ "eval.tests.test_io_isolation_robustness.test_stdin_is_ignored_short_payload[command_like_text]",
431
+ "eval.tests.test_io_isolation_robustness.test_stdin_is_ignored_short_payload[empty]",
432
+ "eval.tests.test_io_isolation_robustness.test_stdin_is_ignored_short_payload[only_newlines]",
433
+ "eval.tests.test_io_isolation_robustness.test_stdin_is_ignored_short_payload[raw_binary_bytes]",
434
+ "eval.tests.test_io_isolation_robustness.test_stdin_kept_open_is_not_read",
435
+ "eval.tests.test_io_isolation_robustness.test_stdout_is_valid_utf8_without_replacement",
436
+ "eval.tests.test_io_isolation_robustness.test_trailer_is_last_four_lines",
437
+ "eval.tests.test_numeric_invariants.test_argmin_of_separable_quadratic_is_origin",
438
+ "eval.tests.test_numeric_invariants.test_f_at_argmin_is_constant_term",
439
+ "eval.tests.test_numeric_invariants.test_f_delta_equals_value_reduction",
440
+ "eval.tests.test_numeric_invariants.test_final_gradient_tends_to_zero",
441
+ "eval.tests.test_numeric_invariants.test_first_step_is_normalized_initial_descent",
442
+ "eval.tests.test_numeric_invariants.test_gradient_norm_at_optimum_matches_gradient_components",
443
+ "eval.tests.test_numeric_invariants.test_gradient_relates_to_analytic_partial_derivatives",
444
+ "eval.tests.test_numeric_invariants.test_hessian_diagonal_entries_from_second_derivatives",
445
+ "eval.tests.test_numeric_invariants.test_objective_component_contributions[0-500]",
446
+ "eval.tests.test_numeric_invariants.test_objective_component_contributions[1-400]",
447
+ "eval.tests.test_numeric_invariants.test_objective_component_contributions[2-5]",
448
+ "eval.tests.test_numeric_invariants.test_objective_matches_analytic_form",
449
+ "eval.tests.test_numeric_invariants.test_x_delta_equals_coordinate_displacement",
450
+ "eval.tests.test_output_stream_and_layout.test_each_block_header_plus_fields_is_constant_span",
451
+ "eval.tests.test_output_stream_and_layout.test_exact_37_line_span_after_layout_normalization",
452
+ "eval.tests.test_output_stream_and_layout.test_gradient_and_x_rows_are_signed_numeric_vectors",
453
+ "eval.tests.test_output_stream_and_layout.test_live_output_first_ten_lines_match_known_block",
454
+ "eval.tests.test_output_stream_and_layout.test_stderr_empty_when_stdout_is_a_regular_file",
455
+ "eval.tests.test_output_stream_and_layout.test_stdout_redirected_to_file_matches_golden",
456
+ "eval.tests.test_output_stream_and_layout.test_stdout_to_devnull_keeps_exit_zero_and_empty_stderr",
457
+ "eval.tests.test_output_stream_and_layout.test_stdout_to_file_and_pipe_are_byte_identical",
458
+ "eval.tests.test_output_stream_and_layout.test_value_field_is_right_aligned_to_fixed_edge",
459
+ "eval.tests.test_output_stream_and_layout.test_value_field_right_edge_matches_live_run",
460
+ "eval.tests.test_progress_and_convergence.test_argmin_vector_reported",
461
+ "eval.tests.test_progress_and_convergence.test_f_delta_sequence",
462
+ "eval.tests.test_progress_and_convergence.test_final_coordinates_converge_to_origin",
463
+ "eval.tests.test_progress_and_convergence.test_final_coordinates_converge_to_origin_from_negative",
464
+ "eval.tests.test_progress_and_convergence.test_function_value_at_argmin",
465
+ "eval.tests.test_progress_and_convergence.test_gradient_norm_at_last_iterate_is_zero_printed",
466
+ "eval.tests.test_progress_and_convergence.test_header_separator_lines_present",
467
+ "eval.tests.test_progress_and_convergence.test_hessian_condition_ratio",
468
+ "eval.tests.test_progress_and_convergence.test_iteration_blocks_parse_all_expected_labels",
469
+ "eval.tests.test_progress_and_convergence.test_iteration_final_reaches_optimum_value",
470
+ "eval.tests.test_progress_and_convergence.test_iteration_numbers_advance[expected_nums0]",
471
+ "eval.tests.test_progress_and_convergence.test_iteration_zero_gradient",
472
+ "eval.tests.test_progress_and_convergence.test_iteration_zero_is_initial_state",
473
+ "eval.tests.test_progress_and_convergence.test_objective_decreases_monotonically_across_iterations",
474
+ "eval.tests.test_progress_and_convergence.test_progress_produces_three_blocks",
475
+ "eval.tests.test_progress_and_convergence.test_x_delta_positive_before_convergence",
476
+ "eval.tests.test_section_cross_reference.test_each_coordinate_field_row_appears_once_per_block",
477
+ "eval.tests.test_section_cross_reference.test_init_vector_matches_iteration_zero_x",
478
+ "eval.tests.test_section_cross_reference.test_initial_state_gradient_norm_is_zero",
479
+ "eval.tests.test_section_cross_reference.test_preamble_gradient_equals_partial_derivatives_at_start",
480
+ "eval.tests.test_section_cross_reference.test_preamble_gradient_matches_iteration_zero_gradient",
481
+ "eval.tests.test_section_cross_reference.test_preamble_gradient_norm_is_positive_at_start",
482
+ "eval.tests.test_section_cross_reference.test_preamble_value_equals_iteration_zero_value",
483
+ "eval.tests.test_section_cross_reference.test_terminal_section_markers_appear_exactly_once[argmin ]",
484
+ "eval.tests.test_section_cross_reference.test_terminal_section_markers_appear_exactly_once[f in argmin ]",
485
+ "eval.tests.test_section_cross_reference.test_terminal_section_markers_appear_exactly_once[init ]",
486
+ "eval.tests.test_section_cross_reference.test_terminal_section_markers_appear_exactly_once[iterations ]",
487
+ "eval.tests.test_section_cross_reference.test_terminal_section_markers_appear_exactly_once[status ]",
488
+ "eval.tests.test_termination_and_format.test_argmin_formatting_uses_fixed_precision",
489
+ "eval.tests.test_termination_and_format.test_binary_finishes_within_bound[True]",
490
+ "eval.tests.test_termination_and_format.test_binary_runs_from_any_working_directory",
491
+ "eval.tests.test_termination_and_format.test_final_value_printed_after_minimize",
492
+ "eval.tests.test_termination_and_format.test_gradient_norm_precision_at_optimum",
493
+ "eval.tests.test_termination_and_format.test_iterations_count_two",
494
+ "eval.tests.test_termination_and_format.test_no_carriage_returns",
495
+ "eval.tests.test_termination_and_format.test_output_is_full_lines_terminated",
496
+ "eval.tests.test_termination_and_format.test_result_values_are_finite",
497
+ "eval.tests.test_termination_and_format.test_status_is_gradient_norm_too_small",
498
+ "eval.tests.test_termination_and_format.test_status_line_is_last",
499
+ "eval.tests.test_termination_and_format.test_value_formatting_fixed_precision_in_progress",
500
+ "eval.tests.test_termination_and_format.test_value_formatting_width_alignment",
501
+ "eval.tests.test_top_level_output.test_cli_arguments_are_ignored[extra_args0]",
502
+ "eval.tests.test_top_level_output.test_cli_arguments_are_ignored[extra_args1]",
503
+ "eval.tests.test_top_level_output.test_cli_arguments_are_ignored[extra_args2]",
504
+ "eval.tests.test_top_level_output.test_cli_arguments_are_ignored[extra_args3]",
505
+ "eval.tests.test_top_level_output.test_cli_arguments_are_ignored[extra_args4]",
506
+ "eval.tests.test_top_level_output.test_exit_code_is_zero",
507
+ "eval.tests.test_top_level_output.test_gradient_numeric_check_passes",
508
+ "eval.tests.test_top_level_output.test_hessian_numeric_check_reports_false",
509
+ "eval.tests.test_top_level_output.test_init_state_vector_printed",
510
+ "eval.tests.test_top_level_output.test_initial_function_value",
511
+ "eval.tests.test_top_level_output.test_initial_gradient_x0_component",
512
+ "eval.tests.test_top_level_output.test_initial_gradient_x1_component",
513
+ "eval.tests.test_top_level_output.test_result_trailer_present",
514
+ "eval.tests.test_top_level_output.test_section_ordering_is_stable",
515
+ "eval.tests.test_top_level_output.test_stderr_is_left_empty",
516
+ "eval.tests.test_top_level_output.test_stdout_is_not_empty",
517
+ "eval.tests.test_top_level_output.test_stdout_matches_golden"
518
+ ]
519
+ },
520
+ "generated_module_04": {
521
+ "ignore_reason": "",
522
+ "ignored": false,
523
+ "ignored_tests": [
524
+ {
525
+ "name": "eval.tests.test_initial_output.test_initial_x0_coordinate_exact",
526
+ "reasons": [
527
+ {
528
+ "id": "test_network_dependency",
529
+ "message": "test appears to depend on networking",
530
+ "path": "eval/tests/test_initial_output.py",
531
+ "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.",
532
+ "severity": "error",
533
+ "stage": "static_lint"
534
+ }
535
+ ]
536
+ },
537
+ {
538
+ "name": "eval.tests.test_initial_output.test_initial_x1_coordinate_exact",
539
+ "reasons": [
540
+ {
541
+ "id": "test_network_dependency",
542
+ "message": "test appears to depend on networking",
543
+ "path": "eval/tests/test_initial_output.py",
544
+ "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.",
545
+ "severity": "error",
546
+ "stage": "static_lint"
547
+ }
548
+ ]
549
+ },
550
+ {
551
+ "name": "eval.tests.test_report_geometry.test_scalar_and_coordinate_precisions_differ",
552
+ "reasons": [
553
+ {
554
+ "id": "short_substring",
555
+ "message": "pytest test uses a too-short substring oracle",
556
+ "path": "eval/tests/test_report_geometry.py",
557
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
558
+ "severity": "error",
559
+ "stage": "static_lint"
560
+ },
561
+ {
562
+ "id": "generic_keyword_oracle",
563
+ "message": "pytest test uses a generic keyword oracle",
564
+ "path": "eval/tests/test_report_geometry.py",
565
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
566
+ "severity": "error",
567
+ "stage": "static_lint"
568
+ }
569
+ ]
570
+ },
571
+ {
572
+ "name": "eval.tests.test_report_geometry.test_scalar_field_prints_equal_fixed6_format",
573
+ "reasons": [
574
+ {
575
+ "id": "golden_docstring",
576
+ "message": "pytest test docstring mentions golden data that is not used in the body",
577
+ "path": "eval/tests/test_report_geometry.py",
578
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
579
+ "severity": "error",
580
+ "stage": "static_lint"
581
+ },
582
+ {
583
+ "id": "golden_no_equality",
584
+ "message": "pytest test references golden data without equality comparison",
585
+ "path": "eval/tests/test_report_geometry.py",
586
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
587
+ "severity": "error",
588
+ "stage": "static_lint"
589
+ }
590
+ ]
591
+ }
592
+ ],
593
+ "tests": [
594
+ "eval.tests.test_formatting.test_closing_scalar_fields_use_six_decimals",
595
+ "eval.tests.test_formatting.test_iteration_header_number_fixed_width",
596
+ "eval.tests.test_formatting.test_report_is_printable_ascii",
597
+ "eval.tests.test_formatting.test_scalar_fields_use_six_decimal_places",
598
+ "eval.tests.test_formatting.test_status_line_is_last_and_single",
599
+ "eval.tests.test_formatting.test_value_column_width_is_consistent",
600
+ "eval.tests.test_formatting.test_x_and_gradient_lines_carry_two_tokens",
601
+ "eval.tests.test_golden_equivalence.test_golden_is_readonly_reference",
602
+ "eval.tests.test_golden_equivalence.test_golden_paths_resolve_under_branch",
603
+ "eval.tests.test_golden_equivalence.test_golden_stdout_is_nonempty",
604
+ "eval.tests.test_golden_equivalence.test_stderr_equals_committed_golden",
605
+ "eval.tests.test_golden_equivalence.test_stdout_equals_committed_golden",
606
+ "eval.tests.test_golden_equivalence.test_stdout_equals_golden_without_trailing_newline_sensitivity",
607
+ "eval.tests.test_golden_equivalence.test_stdout_sha256_matches_golden_sha256",
608
+ "eval.tests.test_initial_output.test_finite_difference_gradient_check_passes",
609
+ "eval.tests.test_initial_output.test_finite_difference_hessian_check_value",
610
+ "eval.tests.test_initial_output.test_gradient_check_flags_are_booleans",
611
+ "eval.tests.test_initial_output.test_gradient_components_sign",
612
+ "eval.tests.test_initial_output.test_gradient_x0_at_initial_point",
613
+ "eval.tests.test_initial_output.test_gradient_x1_at_initial_point",
614
+ "eval.tests.test_initial_output.test_initial_gradient_matches_objective_gradient",
615
+ "eval.tests.test_initial_output.test_initial_x0_coordinate_exact",
616
+ "eval.tests.test_initial_output.test_initial_x1_coordinate_exact",
617
+ "eval.tests.test_initial_output.test_value_at_initial_point",
618
+ "eval.tests.test_initial_output.test_value_equals_quadratic_form",
619
+ "eval.tests.test_invocation.test_executable_env_is_exported",
620
+ "eval.tests.test_invocation.test_exits_zero",
621
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[help-flag]",
622
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[no-args]",
623
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[short-help]",
624
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[single-positional]",
625
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[two-positional]",
626
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[unexpected-positionals]",
627
+ "eval.tests.test_invocation.test_ignores_command_line_arguments[version-flag]",
628
+ "eval.tests.test_invocation.test_ignores_stdin[arbitrary-text]",
629
+ "eval.tests.test_invocation.test_ignores_stdin[binary-bytes]",
630
+ "eval.tests.test_invocation.test_ignores_stdin[empty-stdin]",
631
+ "eval.tests.test_invocation.test_ignores_stdin[numeric-lines]",
632
+ "eval.tests.test_invocation.test_ignores_stdin[single-newline]",
633
+ "eval.tests.test_invocation.test_multiple_runs_identical_full_stdout",
634
+ "eval.tests.test_invocation.test_parallel_independent_runs_agree",
635
+ "eval.tests.test_invocation.test_process_terminates_promptly",
636
+ "eval.tests.test_invocation.test_programgym_executable_resolves_to_branch",
637
+ "eval.tests.test_invocation.test_sha256_stable_across_runs",
638
+ "eval.tests.test_invocation.test_stderr_is_empty_everywhere",
639
+ "eval.tests.test_invocation.test_stdout_nonempty",
640
+ "eval.tests.test_iteration_table.test_block1_value_matches_golden_fixation",
641
+ "eval.tests.test_iteration_table.test_block_content_pinned_to_golden",
642
+ "eval.tests.test_iteration_table.test_condition_number_ratio",
643
+ "eval.tests.test_iteration_table.test_f_delta_sequence",
644
+ "eval.tests.test_iteration_table.test_final_value_is_minimum",
645
+ "eval.tests.test_iteration_table.test_final_x_near_origin",
646
+ "eval.tests.test_iteration_table.test_first_step_halves_x_magnitude",
647
+ "eval.tests.test_iteration_table.test_gradient_always_equals_analytic",
648
+ "eval.tests.test_iteration_table.test_gradient_norm_final_block_small",
649
+ "eval.tests.test_iteration_table.test_iteration0_gradient_matches_analytic",
650
+ "eval.tests.test_iteration_table.test_iteration0_point_stays_at_init",
651
+ "eval.tests.test_iteration_table.test_iteration0_reports_initial_value",
652
+ "eval.tests.test_iteration_table.test_iteration_indices_are_sequential",
653
+ "eval.tests.test_iteration_table.test_second_step_reaches_origin",
654
+ "eval.tests.test_iteration_table.test_three_iteration_blocks_reported",
655
+ "eval.tests.test_iteration_table.test_value_always_equals_quadratic",
656
+ "eval.tests.test_iteration_table.test_value_never_decreases_from_iter0_to_iter2",
657
+ "eval.tests.test_iteration_table.test_value_report_decreases_monotonically",
658
+ "eval.tests.test_iteration_table.test_x_delta_sequence",
659
+ "eval.tests.test_layout.test_all_column_keywords_appear",
660
+ "eval.tests.test_layout.test_argmin_and_summary_lines_present",
661
+ "eval.tests.test_layout.test_each_block_has_exactly_seven_fields",
662
+ "eval.tests.test_layout.test_iteration_headers_are_zero_indexed",
663
+ "eval.tests.test_layout.test_iteration_headers_present",
664
+ "eval.tests.test_layout.test_no_blank_lines_in_report",
665
+ "eval.tests.test_layout.test_report_opens_with_objective_value",
666
+ "eval.tests.test_layout.test_reported_gradient_norm_is_infinity_norm",
667
+ "eval.tests.test_layout.test_separators_between_blocks",
668
+ "eval.tests.test_layout.test_value_column_present_in_every_block",
669
+ "eval.tests.test_layout.test_x_delta_field_is_positive_when_stepping",
670
+ "eval.tests.test_math_self_consistency.test_converged_gradient_norm_consistent_with_argmin",
671
+ "eval.tests.test_math_self_consistency.test_f_delta_equals_precise_value_drop",
672
+ "eval.tests.test_math_self_consistency.test_gradient_sup_norm_placeholder_semantics",
673
+ "eval.tests.test_math_self_consistency.test_hessian_cond_derived_from_quadratic_coefficients",
674
+ "eval.tests.test_math_self_consistency.test_objective_value_is_positive_definite_quadratic",
675
+ "eval.tests.test_math_self_consistency.test_total_displacement_equals_sum_of_steps",
676
+ "eval.tests.test_math_self_consistency.test_update_direction_is_descent",
677
+ "eval.tests.test_objective_identity.test_converged_iterate_point_matches_argmin",
678
+ "eval.tests.test_objective_identity.test_converged_iterate_value_matches_solution",
679
+ "eval.tests.test_objective_identity.test_f_at_argmin_is_global_minimum_over_grid",
680
+ "eval.tests.test_objective_identity.test_f_at_argmin_not_exceeded_by_origin_eval",
681
+ "eval.tests.test_objective_identity.test_origin_is_stationary_point",
682
+ "eval.tests.test_objective_identity.test_regularized_quadratic_value_at_origin",
683
+ "eval.tests.test_objective_identity.test_solution_gradient_is_zero",
684
+ "eval.tests.test_parsing.test_iteration_blocks_are_typed",
685
+ "eval.tests.test_parsing.test_parse_handles_trailing_whitespace",
686
+ "eval.tests.test_parsing.test_parse_rejects_empty_stdout",
687
+ "eval.tests.test_parsing.test_parse_rejects_garbage_first_line",
688
+ "eval.tests.test_parsing.test_parse_rejects_truncated_table",
689
+ "eval.tests.test_parsing.test_parse_returns_program_output_type",
690
+ "eval.tests.test_report_geometry.test_block_separator_is_exactly_twentyfive_dashes",
691
+ "eval.tests.test_report_geometry.test_gradient_coords_use_six_significant_digit_format",
692
+ "eval.tests.test_report_geometry.test_init_line_raw_tokens",
693
+ "eval.tests.test_report_geometry.test_report_total_line_count_is_fixed",
694
+ "eval.tests.test_report_geometry.test_scalar_and_coordinate_precisions_differ",
695
+ "eval.tests.test_report_geometry.test_scalar_field_prints_equal_fixed6_format",
696
+ "eval.tests.test_report_geometry.test_scalar_fields_share_one_right_aligned_column",
697
+ "eval.tests.test_report_geometry.test_summary_coordinates_are_fixed_six_decimal",
698
+ "eval.tests.test_report_geometry.test_table_label_field_is_constant_width",
699
+ "eval.tests.test_report_geometry.test_table_x_vs_summary_precision_are_distinct",
700
+ "eval.tests.test_report_geometry.test_x_coord_prints_equal_6sig_format",
701
+ "eval.tests.test_report_geometry.test_x_coords_use_six_significant_digit_format",
702
+ "eval.tests.test_robustness.test_all_byte_values_stdin_ignored",
703
+ "eval.tests.test_robustness.test_concurrent_stdin_and_no_stdin_agree",
704
+ "eval.tests.test_robustness.test_large_binary_stdin_does_not_corrupt_output",
705
+ "eval.tests.test_robustness.test_long_run_of_many_invocations_is_stable",
706
+ "eval.tests.test_robustness.test_no_input_and_large_input_agree_many_times",
707
+ "eval.tests.test_solution.test_argmin_is_global_minimum",
708
+ "eval.tests.test_solution.test_argmin_x0_reaches_origin",
709
+ "eval.tests.test_solution.test_argmin_x1_reaches_origin",
710
+ "eval.tests.test_solution.test_exact_argmin_x_present",
711
+ "eval.tests.test_solution.test_f_in_argmin_equals_formula",
712
+ "eval.tests.test_solution.test_f_in_argmin_is_lower_than_initial",
713
+ "eval.tests.test_solution.test_iteration_count_is_two",
714
+ "eval.tests.test_solution.test_iteration_count_matches_table_beyond_zero",
715
+ "eval.tests.test_solution.test_solution_lines_ordered_after_table",
716
+ "eval.tests.test_solution.test_solution_reproducible_every_run",
717
+ "eval.tests.test_solution.test_status_is_not_iteration_limit",
718
+ "eval.tests.test_solution.test_status_phrase_exact",
719
+ "eval.tests.test_solution.test_status_reports_gradient_norm_stop"
720
+ ]
721
+ }
722
+ },
723
+ "commit": "14a997b1368d1647d0b026ab533e6a3f6c41df1e",
724
+ "data_source": "synthetic_programgym",
725
+ "difficulty": "easy",
726
+ "difficulty_score": 1.7824009524965296,
727
+ "eval_clean_hashes": [
728
+ "84fa015c0570af8ef662fcd52f99b32f09b2f48b14c198e218a07d52899d2c5b"
729
+ ],
730
+ "input_record": {
731
+ "commit": "14a997b1368d1647d0b026ab533e6a3f6c41df1e",
732
+ "difficulty": "easy",
733
+ "difficulty_code_lines": 6059,
734
+ "difficulty_has_tests": false,
735
+ "difficulty_product_code_lines": 6059,
736
+ "difficulty_runtime_deps": 0,
737
+ "difficulty_score": 1.7824009524965296,
738
+ "difficulty_test_code_lines": 3988,
739
+ "full_name": "PatWie/CppNumericalSolvers",
740
+ "input_joern_zip": "cpp_joern/PatWie__CppNumericalSolvers.zip",
741
+ "joern_status": true,
742
+ "joern_time": 12.670907666906714,
743
+ "language": "cpp",
744
+ "pb_match": [
745
+ {
746
+ "pb_fullname": "gromacs/gromacs",
747
+ "rank": 176,
748
+ "similarity": 0.5130473971366882
749
+ },
750
+ {
751
+ "pb_fullname": "OSGeo/PROJ",
752
+ "rank": 553,
753
+ "similarity": 0.40196141600608826
754
+ },
755
+ {
756
+ "pb_fullname": "ip7z/7zip",
757
+ "rank": 928,
758
+ "similarity": 0.3721598982810974
759
+ },
760
+ {
761
+ "pb_fullname": "ninja-build/ninja",
762
+ "rank": 605,
763
+ "similarity": 0.4402551054954529
764
+ }
765
+ ],
766
+ "repo_path": "cpp/PatWie__CppNumericalSolvers",
767
+ "source": "commit:14a997b1368d1647d0b026ab533e6a3f6c41df1e",
768
+ "status": "done",
769
+ "url": "https://github.com/PatWie/CppNumericalSolvers"
770
+ },
771
+ "instance_id": "PatWie__CppNumericalSolvers.14a997b",
772
+ "language": "cpp",
773
+ "module_iterations": [
774
+ {
775
+ "actual_iterations": 5,
776
+ "branch_name": "generated_module_01",
777
+ "iteration_limit": 5,
778
+ "module_index": 1,
779
+ "module_kind": "source",
780
+ "termination_reason": "max_iterations"
781
+ },
782
+ {
783
+ "actual_iterations": 5,
784
+ "branch_name": "generated_module_02",
785
+ "iteration_limit": 5,
786
+ "module_index": 2,
787
+ "module_kind": "source",
788
+ "termination_reason": "max_iterations"
789
+ },
790
+ {
791
+ "actual_iterations": 5,
792
+ "branch_name": "generated_module_03",
793
+ "iteration_limit": 5,
794
+ "module_index": 3,
795
+ "module_kind": "source",
796
+ "termination_reason": "early_stopping"
797
+ },
798
+ {
799
+ "actual_iterations": 5,
800
+ "branch_name": "generated_module_04",
801
+ "iteration_limit": 5,
802
+ "module_index": 4,
803
+ "module_kind": "source",
804
+ "termination_reason": "max_iterations"
805
+ }
806
+ ],
807
+ "repository": "PatWie/CppNumericalSolvers"
808
+ }
patwie--cppnumericalsolvers.14a9/tests/test.sh ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets).
5
+ export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}"
6
+
7
+ mkdir -p /logs/verifier /logs/artifacts
8
+
9
+ write_failure() {
10
+ local code="$1"
11
+ local details="$2"
12
+ python3 - "$code" "$details" <<'PY'
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ code, details = sys.argv[1:3]
18
+ try:
19
+ metadata = json.loads(Path("/tests/programgym_task.json").read_text())
20
+ n_tests = sum(
21
+ len([
22
+ name for name in info.get("tests", [])
23
+ if name not in {item.get("name") for item in info.get("ignored_tests", [])}
24
+ ])
25
+ for branch, info in metadata.get("branches", {}).items()
26
+ if not info.get("ignored")
27
+ )
28
+ except Exception:
29
+ n_tests = 0
30
+ result = {
31
+ "test_results": [],
32
+ "error_code": code,
33
+ "error_details": details,
34
+ "log": [],
35
+ "solution_branch": "submission",
36
+ "test_branches": [],
37
+ "test_branch_errors": {
38
+ "__infra__": [{"error_code": code, "error_details": details}]
39
+ },
40
+ "executable_hash": None,
41
+ "warnings": [],
42
+ }
43
+ diagnostics = {
44
+ "pass_rate": 0.0,
45
+ "resolved": 0,
46
+ "n_passed": 0,
47
+ "n_tests": n_tests,
48
+ "n_branch_errors": 1,
49
+ "infra_error": 1,
50
+ "executable_hash_present": 0,
51
+ }
52
+ Path("/logs/verifier/programgym_eval.json").write_text(
53
+ json.dumps(result, indent=2, sort_keys=True)
54
+ )
55
+ Path("/logs/verifier/harbor_diagnostics.json").write_text(
56
+ json.dumps(diagnostics, indent=2, sort_keys=True)
57
+ )
58
+ Path("/logs/verifier/reward.json").write_text(
59
+ json.dumps(
60
+ {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0},
61
+ indent=2,
62
+ sort_keys=True,
63
+ )
64
+ )
65
+ Path("/logs/verifier/reward.txt").write_text("0.0")
66
+ Path("/logs/verifier/programgym_eval.log").write_text(details)
67
+ PY
68
+ }
69
+
70
+ if ! command -v python3 >/dev/null 2>&1; then
71
+ write_failure "missing_python3" "python3 is required in the cleanroom image"
72
+ exit 0
73
+ fi
74
+
75
+ if ! python3 /tests/programgym_evaluator.py; then
76
+ if [ ! -s /logs/verifier/reward.txt ]; then
77
+ write_failure "evaluator_crashed" \
78
+ "programgym_evaluator.py exited non-zero with no reward written"
79
+ fi
80
+ fi
81
+
82
+ exit 0
patwie--cppnumericalsolvers.14a9/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b380bc842552ac08b62b3e2da292ce94625fc28327044afb2d8ae9efe7eefec
3
+ size 4896
pauldreik--rdfind.e50c817/environment/Dockerfile ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV PAGER=cat
35
+ ENV MANPAGER=cat
36
+ ENV LESS=-R
37
+ ENV TQDM_DISABLE=1
38
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/*
39
+ ARG CMAKE_VERSION=3.31.12
40
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
41
+ ARG GCC_VERSION=13.3.0
42
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true
43
+ WORKDIR /workspace
44
+ ADD workspace.tar.gz /workspace/
45
+ COPY executable /workspace/executable
46
+ COPY download.sh /workspace/download.sh
47
+ RUN chmod 755 /workspace/download.sh
48
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
49
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
50
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
51
+ && rm -f /workspace/download.sh \
52
+ && rm -f /tmp/harbor_prepare_download_env.sh
53
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
54
+ RUN chmod 111 /workspace/executable
55
+ WORKDIR /workspace
56
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
57
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
58
+ # submission handed to the separate verifier. Keep the reference executable
59
+ # execute-only; the oracle temporarily restores owner read permission.
60
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
61
+ RUN mkdir -p /home/agent \
62
+ && chown -R agent:agent /home/agent /workspace \
63
+ && chown agent:agent /workspace/executable \
64
+ && chmod 111 /workspace/executable
65
+ ENV HOME=/home/agent
66
+ WORKDIR /workspace
pauldreik--rdfind.e50c817/environment/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
pauldreik--rdfind.e50c817/environment/download.sh ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # download.sh - dependency setup for building rdfind (pauldreik/rdfind).
3
+ #
4
+ # This script is sourced (not executed) by the ProgramGym download stage:
5
+ # source /source_ro/download.sh
6
+ #
7
+ # It runs while the container still has network access, BEFORE the offline
8
+ # build.sh stage. Its only jobs are:
9
+ # 1. install the C/C++ build dependency packages that rdfind needs,
10
+ # 2. prepare any caches / environment that build.sh relies on.
11
+ #
12
+ # It must NOT compile, link, run tests, or otherwise build the project.
13
+ # It must NOT read any repository source files (build.sh does that later).
14
+
15
+ # Fail explicitly whether sourced or executed; do NOT swallow errors.
16
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
17
+ _pb_fail() { return 1; }
18
+ else
19
+ _pb_fail() { exit 1; }
20
+ fi
21
+
22
+ # rdfind (make/configure/autotools already in base image) needs the nettle
23
+ # development headers to compile. nettle is a required (non-optional)
24
+ # dependency per INSTALL and configure.ac. The xxhash dependency is optional
25
+ # (we build with --without-xxhash), so libxxhash-dev is intentionally not
26
+ # installed here to keep runtime dependencies minimal.
27
+ #
28
+ # Install with no recommends to keep the package set minimal and deterministic.
29
+
30
+ echo "download.sh: running apt-get update"
31
+ apt-get update || _pb_fail
32
+ echo "download.sh: installing nettle-dev"
33
+ apt-get install -y --no-install-recommends nettle-dev || _pb_fail
34
+
35
+ # Nothing else to prefetch or export; the autotools build finds nettle via
36
+ # pkg-config / default include and library paths on the base image.
pauldreik--rdfind.e50c817/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:050fe95a155e7755be6e36410fe75229f86364e59f289ca27e9c551774066072
3
+ size 1251232
pauldreik--rdfind.e50c817/environment/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
pauldreik--rdfind.e50c817/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
pauldreik--rdfind.e50c817/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05d7896a86f0522c57ccd0d149ceac853c553b0d418200992ea55b5964b08c47
3
+ size 9746
pauldreik--rdfind.e50c817/instruction.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are a helpful assistant that can interact with a computer.
2
+
3
+ This is a reverse-engineering benchmark. You are given a compiled binary and its documentation.
4
+ Your job is to write a new, original codebase from scratch that produces an executable with identical behavior.
5
+ You must figure out the behavior solely by running and interacting with the provided binary.
6
+ Writing original code based on observed behavior is the entire point of this benchmark.
7
+
8
+ Any approach that shortcuts this — finding existing source code, wrapping the binary,
9
+ or installing the original tool — does not count as a solution. It will be detected by an
10
+ automated judge, marked as a disqualification, and scored as a failure.
11
+ The trace will be posted to an online wall of shame.
12
+
13
+ <RULES>
14
+ ## What is not allowed
15
+
16
+ ### 1. Obtaining source code
17
+
18
+ The only source of truth about what the executable does is the executable itself and its
19
+ bundled documentation. You must not search the internet, package registries, or any external
20
+ source for information about this project's source code. Even if you recognize what the
21
+ executable is, you must reimplement it from behavioral observation alone.
22
+
23
+ This includes but is not limited to:
24
+ - Cloning or browsing the original GitHub repository, its forks, or mirrors
25
+ - Downloading the project from package registries: `cargo install <project>`, `go get github.com/<org>/<project>`, `pip install <project>`, `apt-get source <project>`, `npm install <project>`, etc.
26
+ - Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`)
27
+ - Using a package manager to download the project as a dependency and then reading its cached source (e.g., navigating into `~/.cargo/registry/src/` or `$(go env GOPATH)/pkg/mod/`)
28
+ - Searching the web for the project's source code or implementation details
29
+
30
+ ### 2. Wrapping or reusing the original binary
31
+
32
+ Your submission must be a genuine reimplementation. The provided `./executable` is for
33
+ observation only — your final solution must not depend on it or any other pre-built version
34
+ of the same tool at runtime.
35
+
36
+ This includes but is not limited to:
37
+ - Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`)
38
+ - Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`)
39
+ - Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`)
40
+ - Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`)
41
+ - Re-linking prebuilt `.o` object files found in the workspace without writing new source code
42
+
43
+ ### 3. Binary analysis of the provided executable
44
+
45
+ All information about the provided `./executable` must be obtained by interacting with it
46
+ through its normal user interface (CLI flags, stdin/stdout, etc.).
47
+ - You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it
48
+ - You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable`
49
+
50
+ Note: this restriction applies ONLY to the provided `./executable`. You are free to use any
51
+ analysis tools on binaries that you produce yourself during development.
52
+
53
+ ## What IS allowed
54
+
55
+ - Running the executable with any inputs, flags, and arguments to observe its behavior
56
+ - Reading any documentation files bundled in the workspace
57
+ </RULES>
58
+
59
+ ## Task context
60
+
61
+ We want to write the source code for a given executable.
62
+ The executable is located at `./executable` in the workspace root.
63
+
64
+ You also have access to the existing documentation.
65
+
66
+ ## Your task
67
+
68
+ Implement the source code to generate an executable of exactly identical behavior as the original.
69
+
70
+ No project-specific dependencies are pre-installed.
71
+ You do NOT have access to the internet.
72
+ **IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file.
73
+ Finally, commit your changes.
74
+
75
+ Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root.
76
+ `compile.sh` should be executable and should install any dependencies needed to compile the executable.
77
+ If your compile.sh fails to compile on a fresh checkout, your task has failed.
78
+
79
+ ## Important: This is a reverse-engineering benchmark
80
+
81
+ Your goal is to write original code from scratch that reproduces the executable's behavior.
82
+ The only way to learn what the executable does is to run it and read its bundled documentation.
83
+
84
+ Any attempt to obtain source code — whether successful or not — or to wrap/reuse the
85
+ provided binary will be detected by an automated judge, disqualified, and scored as zero.
86
+ See the full rules in the system prompt above. Key points:
87
+
88
+ - Do NOT search the internet, clone repos, or download the project from any package registry
89
+ - Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool
90
+ - Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine)
91
+ - You SHOULD extensively test the executable to understand its behavior before writing code.
92
+ If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it.
93
+
94
+ ## Recommended Workflow
95
+
96
+ 1. Explore all documentation files
97
+ 2. Play with the executable to understand its behavior (however, you MUST NOT decompile `./executable` or perform any other form of binary or strace/ltrace analysis on it)
98
+ 3. Write the source code to implement the behavior
pauldreik--rdfind.e50c817/solution/solve.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Oracle-only ceiling check. The reference is execute-only for normal agents;
3
+ # because the oracle runs as the owning `agent` user it can temporarily add read
4
+ # permission and encode the binary for Harbor's normal artifact handoff.
5
+ set -euo pipefail
6
+ test -f ./executable
7
+ chmod u+r ./executable
8
+ python3 - <<'PY'
9
+ import base64
10
+ from pathlib import Path
11
+
12
+ Path(".programgym_oracle_reference").write_bytes(
13
+ base64.b64encode(Path("executable").read_bytes())
14
+ )
15
+ PY
16
+ chmod u-r ./executable
17
+ cat > compile.sh <<'EOF'
18
+ #!/usr/bin/env bash
19
+ set -euo pipefail
20
+ if [ -f ./.programgym_oracle_reference ]; then
21
+ python3 - <<'PY'
22
+ import base64
23
+ from pathlib import Path
24
+
25
+ Path("executable").write_bytes(
26
+ base64.b64decode(Path(".programgym_oracle_reference").read_bytes())
27
+ )
28
+ PY
29
+ fi
30
+ test -f ./executable
31
+ chmod +x ./executable
32
+ EOF
33
+ chmod +x compile.sh
pauldreik--rdfind.e50c817/task.toml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ source = "ProgramGym"
3
+ artifacts = [
4
+ "/logs/verifier/programgym_eval.json",
5
+ "/logs/verifier/harbor_diagnostics.json",
6
+ "/logs/verifier/programgym_eval.log",
7
+ "/logs/verifier/reward.json",
8
+ "/logs/verifier/reward.txt",
9
+ # Keep agent/runtime state out of the submission handoff. In particular,
10
+ # Claude Code installs an absolute symlink under .local/bin; transferring it
11
+ # makes Python's safe tar extraction reject the entire workspace archive.
12
+ { source = "/workspace", exclude = [
13
+ "executable",
14
+ ".git",
15
+ ".bashrc",
16
+ ".cache",
17
+ ".cc-switch",
18
+ ".claude",
19
+ ".local",
20
+ ] },
21
+ ]
22
+
23
+ [task]
24
+ name = "programgym/pauldreik--rdfind.e50c817"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for pauldreik/rdfind"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "pauldreik__rdfind.e50c817"
32
+ repository = "pauldreik/rdfind"
33
+ commit = "e50c817ea28fac58810cbefddd2c5b0551a30b44"
34
+ language = "cpp"
35
+ difficulty = "easy"
36
+ difficulty_score = 1.463743721247059
37
+ test_branches = 4
38
+ test_count = 494
39
+
40
+ [agent]
41
+ timeout_sec = 14400
42
+ user = "agent"
43
+ network_mode = "allowlist"
44
+ allowed_hosts = ["api.anthropic.com", "api.openai.com"]
45
+
46
+ [verifier]
47
+ timeout_sec = 7200
48
+ user = "root"
49
+ environment_mode = "separate"
50
+
51
+ [verifier.env]
52
+ PROGRAMGYM_XDIST_WORKERS = "8"
53
+
54
+ [verifier.environment]
55
+ build_timeout_sec = 1800
56
+ cpus = 8
57
+ memory_mb = 16384
58
+ storage_mb = 30720
59
+ gpus = 0
60
+ workdir = "/workspace"
61
+
62
+ [environment]
63
+ network_mode = "public"
64
+ build_timeout_sec = 1800
65
+ cpus = 8
66
+ memory_mb = 16384
67
+ storage_mb = 30720
68
+ gpus = 0
69
+ workdir = "/workspace"
pauldreik--rdfind.e50c817/tests/Dockerfile ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV PAGER=cat
35
+ ENV MANPAGER=cat
36
+ ENV LESS=-R
37
+ ENV TQDM_DISABLE=1
38
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/*
39
+ ARG CMAKE_VERSION=3.31.12
40
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
41
+ ARG GCC_VERSION=13.3.0
42
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true
43
+ WORKDIR /workspace
44
+ ADD workspace.tar.gz /workspace/
45
+ COPY executable /workspace/executable
46
+ COPY download.sh /workspace/download.sh
47
+ RUN chmod 755 /workspace/download.sh
48
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
49
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
50
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
51
+ && rm -f /workspace/download.sh \
52
+ && rm -f /tmp/harbor_prepare_download_env.sh
53
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
54
+ RUN chmod 111 /workspace/executable
55
+ WORKDIR /workspace
56
+ # Harbor uses tests/ as the separate verifier build context. Start with the
57
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
58
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
59
+ && mkdir -p /workspace /tests
60
+
61
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
62
+ # Installing a newer pytest alone leaves that apt package importable and creates
63
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
64
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
65
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
66
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
67
+ RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
68
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
69
+
70
+ COPY test.sh /tests/test.sh
71
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
72
+ COPY programgym_task.json /tests/programgym_task.json
73
+ COPY blobs/ /tests/blobs/
74
+ RUN chmod +x /tests/test.sh
pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_01.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:795459ea1998ef76bcd7adcdd3c7b3429c4436a52253939de9ad2a33f5a77d37
3
+ size 19003
pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_02.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49894c74094afb2a7f929abbe72e25da134766957ab921a372b40bf798eb070c
3
+ size 27266
pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_03.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:375227d5d298007fd7ac0ea1707638247eccfae94bfb32da7da4de0f56e014a3
3
+ size 15484
pauldreik--rdfind.e50c817/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c08241a4670b0b9ed469e72d28a7270832b7cb7fa8f5dab6c2d28a23c7f41b29
3
+ size 28720
pauldreik--rdfind.e50c817/tests/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
pauldreik--rdfind.e50c817/tests/download.sh ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # download.sh - dependency setup for building rdfind (pauldreik/rdfind).
3
+ #
4
+ # This script is sourced (not executed) by the ProgramGym download stage:
5
+ # source /source_ro/download.sh
6
+ #
7
+ # It runs while the container still has network access, BEFORE the offline
8
+ # build.sh stage. Its only jobs are:
9
+ # 1. install the C/C++ build dependency packages that rdfind needs,
10
+ # 2. prepare any caches / environment that build.sh relies on.
11
+ #
12
+ # It must NOT compile, link, run tests, or otherwise build the project.
13
+ # It must NOT read any repository source files (build.sh does that later).
14
+
15
+ # Fail explicitly whether sourced or executed; do NOT swallow errors.
16
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
17
+ _pb_fail() { return 1; }
18
+ else
19
+ _pb_fail() { exit 1; }
20
+ fi
21
+
22
+ # rdfind (make/configure/autotools already in base image) needs the nettle
23
+ # development headers to compile. nettle is a required (non-optional)
24
+ # dependency per INSTALL and configure.ac. The xxhash dependency is optional
25
+ # (we build with --without-xxhash), so libxxhash-dev is intentionally not
26
+ # installed here to keep runtime dependencies minimal.
27
+ #
28
+ # Install with no recommends to keep the package set minimal and deterministic.
29
+
30
+ echo "download.sh: running apt-get update"
31
+ apt-get update || _pb_fail
32
+ echo "download.sh: installing nettle-dev"
33
+ apt-get install -y --no-install-recommends nettle-dev || _pb_fail
34
+
35
+ # Nothing else to prefetch or export; the autotools build finds nettle via
36
+ # pkg-config / default include and library paths on the base image.
pauldreik--rdfind.e50c817/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:050fe95a155e7755be6e36410fe75229f86364e59f289ca27e9c551774066072
3
+ size 1251232
pauldreik--rdfind.e50c817/tests/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
pauldreik--rdfind.e50c817/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
pauldreik--rdfind.e50c817/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
pauldreik--rdfind.e50c817/tests/programgym_task.json ADDED
@@ -0,0 +1,803 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_additional_distinct.test_makeduplicateskeeps_a_before_b_before_c_delete_order",
9
+ "eval.tests.test_additional_distinct.test_makehardlinks_three_way_merges_to_single_inode",
10
+ "eval.tests.test_additional_distinct.test_progress_counter_over_three_files",
11
+ "eval.tests.test_additional_distinct.test_results_nested_within_same_tree_marker_and_depth",
12
+ "eval.tests.test_additional_distinct.test_results_three_way_exact_id_and_depth_columns",
13
+ "eval.tests.test_argument_errors.test_bare_dash_is_unknown_option",
14
+ "eval.tests.test_argument_errors.test_bool_option_invalid_value_errors[-dryrun-1]",
15
+ "eval.tests.test_argument_errors.test_bool_option_invalid_value_errors[-followsymlinks-0]",
16
+ "eval.tests.test_argument_errors.test_bool_option_invalid_value_errors[-ignoreempty-maybe]",
17
+ "eval.tests.test_argument_errors.test_bool_option_invalid_value_errors[-makeresultsfile-on]",
18
+ "eval.tests.test_argument_errors.test_bool_option_invalid_value_errors[-makesymlinks-yes]",
19
+ "eval.tests.test_argument_errors.test_bool_option_invalid_value_errors[-n-TRUE]",
20
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-deleteduplicates]",
21
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-deterministic]",
22
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-dryrun]",
23
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-followsymlinks]",
24
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-ignoreempty]",
25
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-makehardlinks]",
26
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-makeresultsfile]",
27
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-makesymlinks]",
28
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-n]",
29
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-progress]",
30
+ "eval.tests.test_argument_errors.test_bool_option_missing_value_errors[-removeidentinode]",
31
+ "eval.tests.test_argument_errors.test_buffersize_too_large_errors[134217729-128 MiB]",
32
+ "eval.tests.test_argument_errors.test_buffersize_too_large_errors[2000000000-1907 MiB]",
33
+ "eval.tests.test_argument_errors.test_buffersize_too_large_errors[999999999-953 MiB]",
34
+ "eval.tests.test_argument_errors.test_buffersize_zero_or_negative_errors[-100]",
35
+ "eval.tests.test_argument_errors.test_buffersize_zero_or_negative_errors[-5]",
36
+ "eval.tests.test_argument_errors.test_buffersize_zero_or_negative_errors[0]",
37
+ "eval.tests.test_argument_errors.test_checksum_invalid_value_errors[-]",
38
+ "eval.tests.test_argument_errors.test_checksum_invalid_value_errors[SHA1-SHA1]",
39
+ "eval.tests.test_argument_errors.test_checksum_invalid_value_errors[bogus-bogus]",
40
+ "eval.tests.test_argument_errors.test_checksum_invalid_value_errors[md5x-md5x]",
41
+ "eval.tests.test_argument_errors.test_checksum_xxh128_not_compiled",
42
+ "eval.tests.test_argument_errors.test_conflict_error_fires_even_without_file_args",
43
+ "eval.tests.test_argument_errors.test_empty_string_argument_errors",
44
+ "eval.tests.test_argument_errors.test_maxsize_le_minimum_conflict",
45
+ "eval.tests.test_argument_errors.test_negative_firstbytessize_aborts",
46
+ "eval.tests.test_argument_errors.test_negative_lastbytessize_aborts",
47
+ "eval.tests.test_argument_errors.test_negative_maxsize_aborts",
48
+ "eval.tests.test_argument_errors.test_negative_minsize_aborts",
49
+ "eval.tests.test_argument_errors.test_sleep_invalid_value_errors[-5ms]",
50
+ "eval.tests.test_argument_errors.test_sleep_invalid_value_errors[0ms]",
51
+ "eval.tests.test_argument_errors.test_sleep_invalid_value_errors[10]",
52
+ "eval.tests.test_argument_errors.test_sleep_invalid_value_errors[1s]",
53
+ "eval.tests.test_argument_errors.test_sleep_invalid_value_errors[7ms]",
54
+ "eval.tests.test_argument_errors.test_sleep_invalid_value_errors[banana]",
55
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-buffersize]",
56
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-checksum]",
57
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-firstbytessize]",
58
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-lastbytessize]",
59
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-maxsize]",
60
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-minsize]",
61
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-outputname]",
62
+ "eval.tests.test_argument_errors.test_string_option_missing_value_errors[-sleep]",
63
+ "eval.tests.test_argument_errors.test_unknown_option_errors[-duplicate]",
64
+ "eval.tests.test_argument_errors.test_unknown_option_errors[-foobar]",
65
+ "eval.tests.test_argument_errors.test_unknown_option_errors[-hop]",
66
+ "eval.tests.test_argument_errors.test_unknown_option_errors[-xyz]",
67
+ "eval.tests.test_argument_errors.test_unknown_option_reports_correct_index",
68
+ "eval.tests.test_option_acceptance.test_bool_option_value_false_disables_stage",
69
+ "eval.tests.test_option_acceptance.test_buffersize_valid_accepted[1048576]",
70
+ "eval.tests.test_option_acceptance.test_buffersize_valid_accepted[1]",
71
+ "eval.tests.test_option_acceptance.test_buffersize_valid_accepted[65536]",
72
+ "eval.tests.test_option_acceptance.test_checksum_md5_runs_scan",
73
+ "eval.tests.test_option_acceptance.test_checksum_none_prints_danger_and_skips_checksum",
74
+ "eval.tests.test_option_acceptance.test_checksum_sha_variants_select_stage[sha1]",
75
+ "eval.tests.test_option_acceptance.test_checksum_sha_variants_select_stage[sha256]",
76
+ "eval.tests.test_option_acceptance.test_checksum_sha_variants_select_stage[sha512]",
77
+ "eval.tests.test_option_acceptance.test_deterministic_false_still_runs",
78
+ "eval.tests.test_option_acceptance.test_dryrun_false_no_prefix",
79
+ "eval.tests.test_option_acceptance.test_dryrun_true_prefixes_stdout",
80
+ "eval.tests.test_option_acceptance.test_ignoreempty_default_skips_empty_file",
81
+ "eval.tests.test_option_acceptance.test_ignoreempty_false_includes_empty_file",
82
+ "eval.tests.test_option_acceptance.test_ignoreempty_true_skips_empty_file",
83
+ "eval.tests.test_option_acceptance.test_makeresultsfile_false_writes_no_file",
84
+ "eval.tests.test_option_acceptance.test_makeresultsfile_true_writes_results_file",
85
+ "eval.tests.test_option_acceptance.test_maxsize_filters_large_files",
86
+ "eval.tests.test_option_acceptance.test_minsize_and_maxsize_window",
87
+ "eval.tests.test_option_acceptance.test_minsize_filters_small_files",
88
+ "eval.tests.test_option_acceptance.test_n_flag_acts_as_dryrun",
89
+ "eval.tests.test_option_acceptance.test_outputname_is_respected_in_progress_message",
90
+ "eval.tests.test_option_acceptance.test_outputname_renames_results_file",
91
+ "eval.tests.test_option_acceptance.test_progress_true_emits_percent_markers",
92
+ "eval.tests.test_option_acceptance.test_progress_true_runs_scan",
93
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[100ms]",
94
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[10ms]",
95
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[1ms]",
96
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[25ms]",
97
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[2ms]",
98
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[3ms]",
99
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[4ms]",
100
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[50ms]",
101
+ "eval.tests.test_option_acceptance.test_sleep_valid_accepted[5ms]",
102
+ "eval.tests.test_parser_and_cli_boundaries.test_buffersize_max_boundary_128mib_accepted",
103
+ "eval.tests.test_parser_and_cli_boundaries.test_danger_checksum_none_goes_to_stdout",
104
+ "eval.tests.test_parser_and_cli_boundaries.test_dash_n_false_disables_dryrun",
105
+ "eval.tests.test_parser_and_cli_boundaries.test_dryrun_makehardlinks_prints_count_without_merging",
106
+ "eval.tests.test_parser_and_cli_boundaries.test_duplicate_across_file_and_dir_arguments",
107
+ "eval.tests.test_parser_and_cli_boundaries.test_empty_directory_scans_zero_files",
108
+ "eval.tests.test_parser_and_cli_boundaries.test_empty_file_duplicates_counted_with_ignoreempty_false",
109
+ "eval.tests.test_parser_and_cli_boundaries.test_first_and_last_bytes_stages_named_when_enabled",
110
+ "eval.tests.test_parser_and_cli_boundaries.test_firstbytessize_zero_and_lastbytessize_zero_disable_stages",
111
+ "eval.tests.test_parser_and_cli_boundaries.test_followsymlinks_false_skips_symlink_argument",
112
+ "eval.tests.test_parser_and_cli_boundaries.test_followsymlinks_true_counts_symlink_target",
113
+ "eval.tests.test_parser_and_cli_boundaries.test_help_flag_mid_options_short_circuits",
114
+ "eval.tests.test_parser_and_cli_boundaries.test_ignoreempty_false_after_minsize_resets_minimum",
115
+ "eval.tests.test_parser_and_cli_boundaries.test_later_minsize_overrides_ignoreempty_false",
116
+ "eval.tests.test_parser_and_cli_boundaries.test_makeresultsfile_true_explicit_writes_results",
117
+ "eval.tests.test_parser_and_cli_boundaries.test_maxsize_zero_means_unlimited",
118
+ "eval.tests.test_parser_and_cli_boundaries.test_minimum_and_maximum_size_boundaries",
119
+ "eval.tests.test_parser_and_cli_boundaries.test_multiple_distinct_checksums_all_run",
120
+ "eval.tests.test_parser_and_cli_boundaries.test_outputname_into_nonexistent_subdir_fails_before_scan",
121
+ "eval.tests.test_parser_and_cli_boundaries.test_outputname_target_is_directory_fails",
122
+ "eval.tests.test_parser_and_cli_boundaries.test_plain_file_as_scan_argument",
123
+ "eval.tests.test_parser_and_cli_boundaries.test_progress_false_suppresses_progress_primitives",
124
+ "eval.tests.test_parser_and_cli_boundaries.test_removeidentinode_false_keeps_hardlinks_as_duplicates",
125
+ "eval.tests.test_parser_and_cli_boundaries.test_removeidentinode_true_zero_hardlinks_reports_zero",
126
+ "eval.tests.test_parser_and_cli_boundaries.test_repeated_checksum_option_accumulates_modes",
127
+ "eval.tests.test_parser_and_cli_boundaries.test_repeated_outputname_last_wins",
128
+ "eval.tests.test_parser_and_cli_boundaries.test_unknown_option_before_help_is_error",
129
+ "eval.tests.test_parser_and_cli_boundaries.test_version_flag_mid_options_short_circuits",
130
+ "eval.tests.test_parser_state.test_dash_dash_is_unknown",
131
+ "eval.tests.test_parser_state.test_dryrun_then_true_final_dryrun_keeps_file",
132
+ "eval.tests.test_parser_state.test_empty_outputname_value_fails_results_open",
133
+ "eval.tests.test_parser_state.test_min_and_max_size_work_together",
134
+ "eval.tests.test_parser_state.test_multiple_options_chained_before_path",
135
+ "eval.tests.test_parser_state.test_option_after_path_is_treated_as_path",
136
+ "eval.tests.test_parser_state.test_outputname_is_applied_after_outputname_option",
137
+ "eval.tests.test_parser_state.test_repeated_bool_option_last_wins",
138
+ "eval.tests.test_parser_state.test_short_dash_n_alias_confirmed",
139
+ "eval.tests.test_results_golden.test_results_file_contains_all_golden_markers",
140
+ "eval.tests.test_results_golden.test_results_file_duptype_order_is_first_then_outside",
141
+ "eval.tests.test_results_golden.test_results_file_golden_is_read_only_input",
142
+ "eval.tests.test_results_golden.test_results_rows_have_fixed_field_count",
143
+ "eval.tests.test_results_golden.test_results_rows_include_expected_paths_and_sizes",
144
+ "eval.tests.test_scan_and_actions.test_deleteduplicates_removes_duplicate_file",
145
+ "eval.tests.test_scan_and_actions.test_deleteduplicates_with_no_duplicates_deletes_zero",
146
+ "eval.tests.test_scan_and_actions.test_dryrun_does_not_actually_delete",
147
+ "eval.tests.test_scan_and_actions.test_dryrun_makesymlinks_does_not_change_filesystem",
148
+ "eval.tests.test_scan_and_actions.test_duplicate_pair_reported_in_results",
149
+ "eval.tests.test_scan_and_actions.test_identical_files_in_same_directory",
150
+ "eval.tests.test_scan_and_actions.test_keep_higher_ranked_copy",
151
+ "eval.tests.test_scan_and_actions.test_makehardlinks_merges_inodes",
152
+ "eval.tests.test_scan_and_actions.test_makehardlinks_with_no_duplicates_makes_zero",
153
+ "eval.tests.test_scan_and_actions.test_makesymlinks_keeps_original_content_file",
154
+ "eval.tests.test_scan_and_actions.test_makesymlinks_replaces_duplicate_with_symlink",
155
+ "eval.tests.test_scan_and_actions.test_makesymlinks_with_no_duplicates_makes_zero",
156
+ "eval.tests.test_scan_and_actions.test_nonexistent_path_scans_zero_files",
157
+ "eval.tests.test_scan_and_actions.test_recursive_deduplication_between_subdirs",
158
+ "eval.tests.test_scan_and_actions.test_removeidentinode_counts_hardlinks",
159
+ "eval.tests.test_scan_and_actions.test_results_file_header_and_footer",
160
+ "eval.tests.test_scan_and_actions.test_reversed_order_keeps_other_copy",
161
+ "eval.tests.test_scan_and_actions.test_scan_reports_files_found_per_directory",
162
+ "eval.tests.test_scan_and_actions.test_scan_reports_total_size",
163
+ "eval.tests.test_scan_and_actions.test_three_way_duplicate_actions",
164
+ "eval.tests.test_scan_and_actions.test_trailing_slash_stripped_in_scan_message",
165
+ "eval.tests.test_scan_and_actions.test_unique_files_not_reported_as_duplicates",
166
+ "eval.tests.test_scan_and_actions.test_zero_duplicates_reports_no_reduction",
167
+ "eval.tests.test_usage_help_version.test_help_does_not_mutate_working_dir",
168
+ "eval.tests.test_usage_help_version.test_help_flags_print_usage_and_exit_zero[--help]",
169
+ "eval.tests.test_usage_help_version.test_help_flags_print_usage_and_exit_zero[-h]",
170
+ "eval.tests.test_usage_help_version.test_help_flags_print_usage_and_exit_zero[-help]",
171
+ "eval.tests.test_usage_help_version.test_help_priority_over_unknown_option",
172
+ "eval.tests.test_usage_help_version.test_no_arguments_prints_usage_and_exit_zero",
173
+ "eval.tests.test_usage_help_version.test_version_flags_print_version_and_exit_zero[--version]",
174
+ "eval.tests.test_usage_help_version.test_version_flags_print_version_and_exit_zero[-v]",
175
+ "eval.tests.test_usage_help_version.test_version_flags_print_version_and_exit_zero[-version]",
176
+ "eval.tests.test_usage_help_version.test_version_lock_check"
177
+ ]
178
+ },
179
+ "generated_module_02": {
180
+ "ignore_reason": "",
181
+ "ignored": false,
182
+ "ignored_tests": [
183
+ {
184
+ "name": "eval.tests.test_fileinfo_duptype.test_outputname_into_missing_subdirectory_fails",
185
+ "reasons": [
186
+ {
187
+ "id": "golden_written_in_test",
188
+ "message": "pytest test writes to its own golden file",
189
+ "path": "eval/tests/test_fileinfo_duptype.py",
190
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
191
+ "severity": "error",
192
+ "stage": "static_lint"
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "name": "eval.tests.test_fileinfo_operations.test_cross_root_deleteduplicates_keeps_first_root",
198
+ "reasons": [
199
+ {
200
+ "id": "golden_written_in_test",
201
+ "message": "pytest test writes to its own golden file",
202
+ "path": "eval/tests/test_fileinfo_operations.py",
203
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
204
+ "severity": "error",
205
+ "stage": "static_lint"
206
+ }
207
+ ]
208
+ },
209
+ {
210
+ "name": "eval.tests.test_fileinfo_operations.test_cross_root_makesymlink_points_at_first_root_file",
211
+ "reasons": [
212
+ {
213
+ "id": "generic_keyword_oracle",
214
+ "message": "pytest test uses a generic keyword oracle",
215
+ "path": "eval/tests/test_fileinfo_operations.py",
216
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
217
+ "severity": "error",
218
+ "stage": "static_lint"
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "name": "eval.tests.test_fileinfo_operations.test_group_of_four_two_pairs_delete_one_of_each",
224
+ "reasons": [
225
+ {
226
+ "id": "golden_written_in_test",
227
+ "message": "pytest test writes to its own golden file",
228
+ "path": "eval/tests/test_fileinfo_operations.py",
229
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
230
+ "severity": "error",
231
+ "stage": "static_lint"
232
+ }
233
+ ]
234
+ },
235
+ {
236
+ "name": "eval.tests.test_fileinfo_operations.test_group_of_three_large_files_delete_keeps_one",
237
+ "reasons": [
238
+ {
239
+ "id": "golden_written_in_test",
240
+ "message": "pytest test writes to its own golden file",
241
+ "path": "eval/tests/test_fileinfo_operations.py",
242
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
243
+ "severity": "error",
244
+ "stage": "static_lint"
245
+ }
246
+ ]
247
+ },
248
+ {
249
+ "name": "eval.tests.test_fileinfo_operations.test_makehardlinks_then_rescan_deleteduplicates_keeps_hardlinks",
250
+ "reasons": [
251
+ {
252
+ "id": "golden_written_in_test",
253
+ "message": "pytest test writes to its own golden file",
254
+ "path": "eval/tests/test_fileinfo_operations.py",
255
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
256
+ "severity": "error",
257
+ "stage": "static_lint"
258
+ }
259
+ ]
260
+ },
261
+ {
262
+ "name": "eval.tests.test_reachability_scan.test_deep_cwd_makesymlink_reports_getcwd_failure",
263
+ "reasons": [
264
+ {
265
+ "id": "golden_written_in_test",
266
+ "message": "pytest test writes to its own golden file",
267
+ "path": "eval/tests/test_reachability_scan.py",
268
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
269
+ "severity": "error",
270
+ "stage": "static_lint"
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "name": "eval.tests.test_reachability_scan.test_progress_flag_emits_exact_ansi_transcript",
276
+ "reasons": [
277
+ {
278
+ "id": "short_substring",
279
+ "message": "pytest test uses a too-short substring oracle",
280
+ "path": "eval/tests/test_reachability_scan.py",
281
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
282
+ "severity": "error",
283
+ "stage": "static_lint"
284
+ },
285
+ {
286
+ "id": "generic_keyword_oracle",
287
+ "message": "pytest test uses a generic keyword oracle",
288
+ "path": "eval/tests/test_reachability_scan.py",
289
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
290
+ "severity": "error",
291
+ "stage": "static_lint"
292
+ },
293
+ {
294
+ "id": "golden_written_in_test",
295
+ "message": "pytest test writes to its own golden file",
296
+ "path": "eval/tests/test_reachability_scan.py",
297
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
298
+ "severity": "error",
299
+ "stage": "static_lint"
300
+ }
301
+ ]
302
+ }
303
+ ],
304
+ "tests": [
305
+ "eval.tests.test_dirlist_traversal.test_absolute_and_relative_path_arguments",
306
+ "eval.tests.test_dirlist_traversal.test_broken_symlink_skipped_when_not_following",
307
+ "eval.tests.test_dirlist_traversal.test_deeply_nested_files_all_discovered",
308
+ "eval.tests.test_dirlist_traversal.test_directory_with_only_subdirectories_reports_zero",
309
+ "eval.tests.test_dirlist_traversal.test_dot_and_dotdot_entries_are_skipped",
310
+ "eval.tests.test_dirlist_traversal.test_double_trailing_slash_stripped",
311
+ "eval.tests.test_dirlist_traversal.test_empty_directory_reports_zero_files",
312
+ "eval.tests.test_dirlist_traversal.test_empty_file_excluded_by_default",
313
+ "eval.tests.test_dirlist_traversal.test_empty_file_included_with_ignoreempty_false",
314
+ "eval.tests.test_dirlist_traversal.test_flat_directory_counts_each_regular_file",
315
+ "eval.tests.test_dirlist_traversal.test_followsymlinks_increases_file_count_over_default",
316
+ "eval.tests.test_dirlist_traversal.test_hidden_dotfile_scanned",
317
+ "eval.tests.test_dirlist_traversal.test_many_branches_all_traversed",
318
+ "eval.tests.test_dirlist_traversal.test_maxsize_exclusive_boundary_excludes_equal_size",
319
+ "eval.tests.test_dirlist_traversal.test_maxsize_keeps_smaller_file",
320
+ "eval.tests.test_dirlist_traversal.test_minsize_and_maxsize_together",
321
+ "eval.tests.test_dirlist_traversal.test_minsize_exclusive_of_smaller",
322
+ "eval.tests.test_dirlist_traversal.test_minsize_filters_small_files_out_of_scan",
323
+ "eval.tests.test_dirlist_traversal.test_minsize_inclusive_boundary_counts_equal_size_file",
324
+ "eval.tests.test_dirlist_traversal.test_multiple_paths_each_scanned",
325
+ "eval.tests.test_dirlist_traversal.test_nested_directory_depth_observed_in_results",
326
+ "eval.tests.test_dirlist_traversal.test_nested_files_counted_recursively",
327
+ "eval.tests.test_dirlist_traversal.test_nonascii_filename_scanned",
328
+ "eval.tests.test_dirlist_traversal.test_recursion_limit_exceeded_reports_stderr_and_stops",
329
+ "eval.tests.test_dirlist_traversal.test_same_directory_scanned_twice_accumulates",
330
+ "eval.tests.test_dirlist_traversal.test_scan_directory_then_file_inside_accumulates",
331
+ "eval.tests.test_dirlist_traversal.test_symlink_loop_with_follow_terminates",
332
+ "eval.tests.test_dirlist_traversal.test_symlink_to_directory_followed_with_followsymlinks",
333
+ "eval.tests.test_dirlist_traversal.test_symlink_to_directory_not_followed_by_default",
334
+ "eval.tests.test_dirlist_traversal.test_symlink_to_file_followed_with_followsymlinks",
335
+ "eval.tests.test_dirlist_traversal.test_symlink_to_file_not_followed_by_default",
336
+ "eval.tests.test_dirlist_traversal.test_trailing_slash_on_directory_is_accepted",
337
+ "eval.tests.test_fileinfo_coverage.test_large_distinct_files_removed_before_duplicates",
338
+ "eval.tests.test_fileinfo_coverage.test_large_duplicate_files_detected_across_checksums[md5]",
339
+ "eval.tests.test_fileinfo_coverage.test_large_duplicate_files_detected_across_checksums[sha1]",
340
+ "eval.tests.test_fileinfo_coverage.test_large_duplicate_files_detected_across_checksums[sha256]",
341
+ "eval.tests.test_fileinfo_coverage.test_large_duplicate_files_detected_across_checksums[sha512]",
342
+ "eval.tests.test_fileinfo_coverage.test_large_duplicate_files_exercise_chunked_byte_read",
343
+ "eval.tests.test_fileinfo_coverage.test_makesymlink_simplifies_dot_slash_in_target",
344
+ "eval.tests.test_fileinfo_coverage.test_makesymlink_simplifies_double_slash_target_from_root_cwd",
345
+ "eval.tests.test_fileinfo_duptype.test_cross_commandline_roots_marked_outside_tree",
346
+ "eval.tests.test_fileinfo_duptype.test_duplicate_files_marked_within_same_tree",
347
+ "eval.tests.test_fileinfo_duptype.test_duplicate_identity_is_negative_of_original",
348
+ "eval.tests.test_fileinfo_duptype.test_hardlinked_files_share_inode",
349
+ "eval.tests.test_fileinfo_duptype.test_inode_and_device_columns_recorded",
350
+ "eval.tests.test_fileinfo_duptype.test_no_duplicate_when_content_differs",
351
+ "eval.tests.test_fileinfo_duptype.test_no_results_file_when_makeresultsfile_false",
352
+ "eval.tests.test_fileinfo_duptype.test_outputname_controls_results_path",
353
+ "eval.tests.test_fileinfo_duptype.test_outputname_into_existing_subdirectory_writes_results",
354
+ "eval.tests.test_fileinfo_duptype.test_outputname_into_missing_subdirectory_fails",
355
+ "eval.tests.test_fileinfo_duptype.test_priority_column_orders_scan_roots_by_commandline",
356
+ "eval.tests.test_fileinfo_duptype.test_results_file_created_by_default",
357
+ "eval.tests.test_fileinfo_duptype.test_results_file_header_format",
358
+ "eval.tests.test_fileinfo_duptype.test_size_column_matches_file_size",
359
+ "eval.tests.test_fileinfo_duptype.test_unique_only_tree_has_empty_results_body",
360
+ "eval.tests.test_fileinfo_operations.test_cross_root_deleteduplicates_keeps_first_root",
361
+ "eval.tests.test_fileinfo_operations.test_cross_root_makesymlink_points_at_first_root_file",
362
+ "eval.tests.test_fileinfo_operations.test_deleteduplicates_keeps_original_keyed_by_rank",
363
+ "eval.tests.test_fileinfo_operations.test_deleteduplicates_leaves_unique_files",
364
+ "eval.tests.test_fileinfo_operations.test_deleteduplicates_removes_duplicate_file",
365
+ "eval.tests.test_fileinfo_operations.test_dryrun_delete_does_not_delete",
366
+ "eval.tests.test_fileinfo_operations.test_dryrun_n_flag_is_an_alias",
367
+ "eval.tests.test_fileinfo_operations.test_group_of_four_two_pairs_delete_one_of_each",
368
+ "eval.tests.test_fileinfo_operations.test_group_of_three_large_files_delete_keeps_one",
369
+ "eval.tests.test_fileinfo_operations.test_identically_inoded_distinct_files_not_deduped",
370
+ "eval.tests.test_fileinfo_operations.test_makehardlinks_creates_hard_link",
371
+ "eval.tests.test_fileinfo_operations.test_makehardlinks_dryrun_does_not_link",
372
+ "eval.tests.test_fileinfo_operations.test_makehardlinks_then_rescan_deleteduplicates_keeps_hardlinks",
373
+ "eval.tests.test_fileinfo_operations.test_makesymlinks_creates_symlink_to_original",
374
+ "eval.tests.test_fileinfo_operations.test_makesymlinks_dryrun_leaves_files",
375
+ "eval.tests.test_fileinfo_operations.test_removeidentinode_dedupes_hard_links",
376
+ "eval.tests.test_fileinfo_operations.test_removeidentinode_false_keeps_hard_links_as_distinct",
377
+ "eval.tests.test_fileinfo_read.test_broken_symlink_followed_triggers_readfileinfo_failure",
378
+ "eval.tests.test_fileinfo_read.test_broken_symlink_not_followed_does_not_dereference",
379
+ "eval.tests.test_fileinfo_read.test_file_size_recorded_correctly_in_results",
380
+ "eval.tests.test_fileinfo_read.test_missing_directory_argument_reports_zero",
381
+ "eval.tests.test_fileinfo_read.test_missing_file_argument_reports_zero_and_exits_ok",
382
+ "eval.tests.test_fileinfo_read.test_multiple_files_passed_directly",
383
+ "eval.tests.test_fileinfo_read.test_permission_denied_directory_oracle",
384
+ "eval.tests.test_fileinfo_read.test_regular_file_passed_directly_is_scanned",
385
+ "eval.tests.test_fileinfo_read.test_symlink_passed_directly_followed_is_scanned",
386
+ "eval.tests.test_fileinfo_read.test_symlink_passed_directly_not_followed_is_skipped",
387
+ "eval.tests.test_fileinfo_read.test_symlink_to_directory_passed_directly_walks_it",
388
+ "eval.tests.test_fileinfo_read.test_three_identical_files_reduce_two_copies",
389
+ "eval.tests.test_fileinfo_read.test_zero_byte_file_size_zero",
390
+ "eval.tests.test_module_extra_behavior.test_checksum_stage_eliminates_middle_diff",
391
+ "eval.tests.test_module_extra_behavior.test_deduplicate_group_of_three_dryrun_keeps_all",
392
+ "eval.tests.test_module_extra_behavior.test_deduplicate_group_of_three_keeps_one",
393
+ "eval.tests.test_module_extra_behavior.test_first_bytes_stage_eliminates_leading_diff",
394
+ "eval.tests.test_module_extra_behavior.test_large_duplicate_pair_kept_after_byte_stages",
395
+ "eval.tests.test_module_extra_behavior.test_last_bytes_stage_eliminates_trailing_diff",
396
+ "eval.tests.test_module_extra_behavior.test_makehardlinks_group_of_three_shares_inode",
397
+ "eval.tests.test_module_extra_behavior.test_makesymlinks_group_of_three_creates_two_links",
398
+ "eval.tests.test_module_extra_behavior.test_small_first_bytes_window_defers_elimination",
399
+ "eval.tests.test_reachability_scan.test_bool_option_bad_value_fails",
400
+ "eval.tests.test_reachability_scan.test_bool_option_missing_value_fails",
401
+ "eval.tests.test_reachability_scan.test_buffersize_valid_value_accepted",
402
+ "eval.tests.test_reachability_scan.test_checksum_bad_value_fails",
403
+ "eval.tests.test_reachability_scan.test_checksum_none_prints_skip_warning",
404
+ "eval.tests.test_reachability_scan.test_checksum_xxh128_not_compiled_fails_exactly",
405
+ "eval.tests.test_reachability_scan.test_deep_cwd_makehardlink_uses_relative_target_without_getcwd",
406
+ "eval.tests.test_reachability_scan.test_deep_cwd_makesymlink_reports_getcwd_failure",
407
+ "eval.tests.test_reachability_scan.test_deterministic_ordering_both_values",
408
+ "eval.tests.test_reachability_scan.test_first_and_last_byte_stages_both_disabled",
409
+ "eval.tests.test_reachability_scan.test_first_and_last_byte_stages_present_by_default",
410
+ "eval.tests.test_reachability_scan.test_firstbytessize_zero_disables_stage",
411
+ "eval.tests.test_reachability_scan.test_help_flag_shows_usage",
412
+ "eval.tests.test_reachability_scan.test_huge_buffersize_rejected",
413
+ "eval.tests.test_reachability_scan.test_invalid_sleep_value_fails",
414
+ "eval.tests.test_reachability_scan.test_lastbytessize_zero_disables_stage",
415
+ "eval.tests.test_reachability_scan.test_maxsize_below_minsize_rejected",
416
+ "eval.tests.test_reachability_scan.test_negative_minsize_rejected",
417
+ "eval.tests.test_reachability_scan.test_no_arguments_shows_usage",
418
+ "eval.tests.test_reachability_scan.test_nonzero_zero_buffersize_rejected",
419
+ "eval.tests.test_reachability_scan.test_progress_flag_emits_exact_ansi_transcript",
420
+ "eval.tests.test_reachability_scan.test_ranking_orders_duplicate_originals_by_commandline",
421
+ "eval.tests.test_reachability_scan.test_scan_detects_duplicates_across_checksum_modes[md5]",
422
+ "eval.tests.test_reachability_scan.test_scan_detects_duplicates_across_checksum_modes[none]",
423
+ "eval.tests.test_reachability_scan.test_scan_detects_duplicates_across_checksum_modes[sha1]",
424
+ "eval.tests.test_reachability_scan.test_scan_detects_duplicates_across_checksum_modes[sha256]",
425
+ "eval.tests.test_reachability_scan.test_scan_detects_duplicates_across_checksum_modes[sha512]",
426
+ "eval.tests.test_reachability_scan.test_scan_with_no_duplicates_reports_zero_unique",
427
+ "eval.tests.test_reachability_scan.test_unknown_option_fails",
428
+ "eval.tests.test_reachability_scan.test_version_flag_prints_version",
429
+ "eval.tests.test_special_and_reporting.test_character_device_passed_directly_reports_nonregular",
430
+ "eval.tests.test_special_and_reporting.test_empty_string_argument_is_rejected",
431
+ "eval.tests.test_special_and_reporting.test_fifo_in_directory_ignored_by_traversal",
432
+ "eval.tests.test_special_and_reporting.test_fifo_passed_directly_reports_nonregular",
433
+ "eval.tests.test_special_and_reporting.test_invalid_sleep_value_rejected",
434
+ "eval.tests.test_special_and_reporting.test_no_saveable_space_with_unique_files",
435
+ "eval.tests.test_special_and_reporting.test_progress_flag_does_not_break_scan",
436
+ "eval.tests.test_special_and_reporting.test_saveable_space_reports_duplicate_bytes",
437
+ "eval.tests.test_special_and_reporting.test_symlink_to_special_file_reported",
438
+ "eval.tests.test_special_and_reporting.test_total_size_reports_sum_of_all_files",
439
+ "eval.tests.test_special_and_reporting.test_valid_sleep_values_accepted[100ms]",
440
+ "eval.tests.test_special_and_reporting.test_valid_sleep_values_accepted[1ms]",
441
+ "eval.tests.test_special_and_reporting.test_valid_sleep_values_accepted[25ms]",
442
+ "eval.tests.test_special_and_reporting.test_valid_sleep_values_accepted[2ms]",
443
+ "eval.tests.test_special_and_reporting.test_valid_sleep_values_accepted[5ms]"
444
+ ]
445
+ },
446
+ "generated_module_03": {
447
+ "ignore_reason": "",
448
+ "ignored": false,
449
+ "ignored_tests": [],
450
+ "tests": [
451
+ "eval.tests.test_checksum_content.test_checksum_interacts_with_firstlast_bytes",
452
+ "eval.tests.test_checksum_content.test_checksum_none_groups_same_size_diff_content",
453
+ "eval.tests.test_checksum_content.test_checksum_sha1_separates_middle_content_when_prefilters_off",
454
+ "eval.tests.test_checksum_content.test_differs_only_in_byte_makes_file_unique",
455
+ "eval.tests.test_checksum_content.test_duplicate_count_matches_identical_file_count",
456
+ "eval.tests.test_checksum_content.test_empty_files_grouped_as_duplicates",
457
+ "eval.tests.test_checksum_content.test_file_equal_to_buffer_boundary_hashed_exactly_once",
458
+ "eval.tests.test_checksum_content.test_identical_files_kept_as_duplicates_every_algorithm[md5]",
459
+ "eval.tests.test_checksum_content.test_identical_files_kept_as_duplicates_every_algorithm[sha1]",
460
+ "eval.tests.test_checksum_content.test_identical_files_kept_as_duplicates_every_algorithm[sha256]",
461
+ "eval.tests.test_checksum_content.test_identical_files_kept_as_duplicates_every_algorithm[sha512]",
462
+ "eval.tests.test_checksum_content.test_ignoreempty_true_default_drops_empty_files",
463
+ "eval.tests.test_checksum_content.test_large_file_hashed_across_buffer_boundary",
464
+ "eval.tests.test_checksum_content.test_middle_byte_difference_isolated_by_full_checksum[md5-2000]",
465
+ "eval.tests.test_checksum_content.test_middle_byte_difference_isolated_by_full_checksum[sha1-700]",
466
+ "eval.tests.test_checksum_content.test_middle_byte_difference_isolated_by_full_checksum[sha256-182]",
467
+ "eval.tests.test_checksum_content.test_middle_byte_difference_isolated_by_full_checksum[sha512-4096]",
468
+ "eval.tests.test_checksum_content.test_prefilter_same_edges_checksum_separates",
469
+ "eval.tests.test_checksum_content.test_results_file_dup_topology[md5]",
470
+ "eval.tests.test_checksum_content.test_results_file_dup_topology[sha1]",
471
+ "eval.tests.test_checksum_content.test_results_file_dup_topology[sha256]",
472
+ "eval.tests.test_checksum_content.test_results_file_dup_topology[sha512]",
473
+ "eval.tests.test_checksum_content.test_same_hash_content_grouped_regardless_of_filename",
474
+ "eval.tests.test_checksum_option.test_checksum_case_and_whitespace_sensitivity[M D5]",
475
+ "eval.tests.test_checksum_option.test_checksum_case_and_whitespace_sensitivity[SHA1]",
476
+ "eval.tests.test_checksum_option.test_checksum_case_and_whitespace_sensitivity[]",
477
+ "eval.tests.test_checksum_option.test_checksum_case_and_whitespace_sensitivity[md5 ]",
478
+ "eval.tests.test_checksum_option.test_checksum_case_and_whitespace_sensitivity[sha_256]",
479
+ "eval.tests.test_checksum_option.test_checksum_invalid_value_rejected",
480
+ "eval.tests.test_checksum_option.test_checksum_missing_value_consumes_next_arg",
481
+ "eval.tests.test_checksum_option.test_checksum_none_skips_checksumming_stage",
482
+ "eval.tests.test_checksum_option.test_checksum_stage_line_appears_for_each_type[md5-md5 checksum]",
483
+ "eval.tests.test_checksum_option.test_checksum_stage_line_appears_for_each_type[sha1-sha1 checksum]",
484
+ "eval.tests.test_checksum_option.test_checksum_stage_line_appears_for_each_type[sha256-sha256 checksum]",
485
+ "eval.tests.test_checksum_option.test_checksum_stage_line_appears_for_each_type[sha512-sha512 checksum]",
486
+ "eval.tests.test_checksum_option.test_checksum_xxh128_not_compiled",
487
+ "eval.tests.test_checksum_option.test_default_checksum_is_sha1",
488
+ "eval.tests.test_checksum_option.test_multiple_checksum_flags_run_all_stages",
489
+ "eval.tests.test_checksum_option.test_three_checksum_flags_run_three_stages",
490
+ "eval.tests.test_checksum_pipeline.test_deterministic_false_delete_leaves_single_survivor",
491
+ "eval.tests.test_checksum_pipeline.test_deterministic_false_still_groups_duplicates",
492
+ "eval.tests.test_checksum_pipeline.test_dryrun_sha256_reports_checksum_stage",
493
+ "eval.tests.test_checksum_pipeline.test_empty_input_directory_still_runs_checksum_stage",
494
+ "eval.tests.test_checksum_pipeline.test_max_size_excludes_large_files",
495
+ "eval.tests.test_checksum_pipeline.test_maxsize_zero_disables_cap",
496
+ "eval.tests.test_checksum_pipeline.test_min_size_gates_reaching_hashes",
497
+ "eval.tests.test_checksum_pipeline.test_minsize_exact_boundary_file_hashed",
498
+ "eval.tests.test_checksum_pipeline.test_normal_build_emits_no_debug_noise",
499
+ "eval.tests.test_checksum_pipeline.test_progress_disabled_keeps_plain_lines",
500
+ "eval.tests.test_checksum_pipeline.test_progress_output_present_and_normalizable",
501
+ "eval.tests.test_checksum_pipeline.test_results_file_disabled",
502
+ "eval.tests.test_checksum_pipeline.test_results_file_respects_outputname",
503
+ "eval.tests.test_checksum_pipeline.test_root_order_decides_which_copy_survives",
504
+ "eval.tests.test_checksum_pipeline.test_small_buffersize_forces_many_updates[md5-md5 checksum]",
505
+ "eval.tests.test_checksum_pipeline.test_small_buffersize_forces_many_updates[sha1-sha1 checksum]",
506
+ "eval.tests.test_checksum_pipeline.test_small_buffersize_forces_many_updates[sha256-sha256 checksum]",
507
+ "eval.tests.test_checksum_pipeline.test_small_buffersize_forces_many_updates[sha512-sha512 checksum]",
508
+ "eval.tests.test_random_delete.test_delete_after_previous_delete_finds_nothing",
509
+ "eval.tests.test_random_delete.test_delete_keeps_content_identical_copy_of_survivor",
510
+ "eval.tests.test_random_delete.test_delete_works_with_sha256_checksum",
511
+ "eval.tests.test_random_delete.test_deleteduplicates_across_subdirectories",
512
+ "eval.tests.test_random_delete.test_deleteduplicates_dryrun_does_not_delete",
513
+ "eval.tests.test_random_delete.test_deleteduplicates_false_is_noop",
514
+ "eval.tests.test_random_delete.test_deleteduplicates_invalid_value_rejected",
515
+ "eval.tests.test_random_delete.test_deleteduplicates_keeps_one_copy",
516
+ "eval.tests.test_random_delete.test_deleteduplicates_leaves_no_temp_residue",
517
+ "eval.tests.test_random_delete.test_deleteduplicates_three_copies_leaves_one",
518
+ "eval.tests.test_random_delete.test_deleteduplicates_with_minsize_gating",
519
+ "eval.tests.test_random_delete.test_hardlinked_copies_deduped_when_removeidentinode_false",
520
+ "eval.tests.test_random_delete.test_hardlinked_copies_keep_both_by_default_removeidentinode",
521
+ "eval.tests.test_random_delete.test_makehardlinks_shares_inode_and_no_residue",
522
+ "eval.tests.test_random_delete.test_makesymlinks_dryrun_reports_without_changing",
523
+ "eval.tests.test_random_delete.test_makesymlinks_replaces_duplicate_with_symlink"
524
+ ]
525
+ },
526
+ "generated_module_04": {
527
+ "ignore_reason": "",
528
+ "ignored": false,
529
+ "ignored_tests": [
530
+ {
531
+ "name": "eval.tests.test_rdutil_actions.test_re_detect_hardlinked_files_as_identical_inode",
532
+ "reasons": [
533
+ {
534
+ "id": "generic_keyword_oracle",
535
+ "message": "pytest test uses a generic keyword oracle",
536
+ "path": "eval/tests/test_rdutil_actions.py",
537
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
538
+ "severity": "error",
539
+ "stage": "static_lint"
540
+ }
541
+ ]
542
+ },
543
+ {
544
+ "name": "eval.tests.test_rdutil_scanargs.test_nonexistent_path_argument_scans_zero_gracefully",
545
+ "reasons": [
546
+ {
547
+ "id": "short_substring",
548
+ "message": "pytest test uses a too-short substring oracle",
549
+ "path": "eval/tests/test_rdutil_scanargs.py",
550
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
551
+ "severity": "error",
552
+ "stage": "static_lint"
553
+ },
554
+ {
555
+ "id": "generic_keyword_oracle",
556
+ "message": "pytest test uses a generic keyword oracle",
557
+ "path": "eval/tests/test_rdutil_scanargs.py",
558
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
559
+ "severity": "error",
560
+ "stage": "static_lint"
561
+ }
562
+ ]
563
+ },
564
+ {
565
+ "name": "eval.tests.test_rdutil_scanargs.test_regular_file_argument_scanned_as_single_file",
566
+ "reasons": [
567
+ {
568
+ "id": "short_substring",
569
+ "message": "pytest test uses a too-short substring oracle",
570
+ "path": "eval/tests/test_rdutil_scanargs.py",
571
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
572
+ "severity": "error",
573
+ "stage": "static_lint"
574
+ },
575
+ {
576
+ "id": "generic_keyword_oracle",
577
+ "message": "pytest test uses a generic keyword oracle",
578
+ "path": "eval/tests/test_rdutil_scanargs.py",
579
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
580
+ "severity": "error",
581
+ "stage": "static_lint"
582
+ }
583
+ ]
584
+ },
585
+ {
586
+ "name": "eval.tests.test_rdutil_scope.test_checksum_sha1_explicit_default_stage",
587
+ "reasons": [
588
+ {
589
+ "id": "short_substring",
590
+ "message": "pytest test uses a too-short substring oracle",
591
+ "path": "eval/tests/test_rdutil_scope.py",
592
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
593
+ "severity": "error",
594
+ "stage": "static_lint"
595
+ }
596
+ ]
597
+ }
598
+ ],
599
+ "tests": [
600
+ "eval.tests.test_rdutil_actions.test_bare_n_requires_bool_value",
601
+ "eval.tests.test_rdutil_actions.test_delete_dryrun_reports_and_keeps_files_golden",
602
+ "eval.tests.test_rdutil_actions.test_delete_dryrun_reports_via_n_flag",
603
+ "eval.tests.test_rdutil_actions.test_delete_then_symlink_both_set_symlink_wins_across_trees",
604
+ "eval.tests.test_rdutil_actions.test_delete_two_groups_and_keep_each_original",
605
+ "eval.tests.test_rdutil_actions.test_delete_writes_results_file_before_deleting",
606
+ "eval.tests.test_rdutil_actions.test_deleteduplicates_leaves_no_duplicates",
607
+ "eval.tests.test_rdutil_actions.test_deleteduplicates_no_dupes_deletes_zero_golden",
608
+ "eval.tests.test_rdutil_actions.test_deleteduplicates_removes_only_duplicates",
609
+ "eval.tests.test_rdutil_actions.test_hardlink_bare_filename_duplicate",
610
+ "eval.tests.test_rdutil_actions.test_hardlink_over_same_inode_rolls_back_unchanged",
611
+ "eval.tests.test_rdutil_actions.test_hardlink_plus_delete_combined",
612
+ "eval.tests.test_rdutil_actions.test_hardlink_wins_over_delete",
613
+ "eval.tests.test_rdutil_actions.test_hardlinks_dryrun_reports_and_unchanged",
614
+ "eval.tests.test_rdutil_actions.test_makehardlinks_content_preserved",
615
+ "eval.tests.test_rdutil_actions.test_makehardlinks_creates_same_inode_golden",
616
+ "eval.tests.test_rdutil_actions.test_makesymlinks_creates_symlinks_golden",
617
+ "eval.tests.test_rdutil_actions.test_makesymlinks_link_target_points_to_original",
618
+ "eval.tests.test_rdutil_actions.test_re_detect_hardlinked_files_as_identical_inode",
619
+ "eval.tests.test_rdutil_actions.test_symlink_action_wins_over_delete",
620
+ "eval.tests.test_rdutil_actions.test_symlink_bare_filename_duplicate",
621
+ "eval.tests.test_rdutil_actions.test_symlink_over_same_inode_becomes_symlink",
622
+ "eval.tests.test_rdutil_actions.test_symlink_target_follows_read",
623
+ "eval.tests.test_rdutil_actions.test_symlinks_dryrun_reports_and_no_link",
624
+ "eval.tests.test_rdutil_detection.test_both_byte_stages_disabled_still_checksums",
625
+ "eval.tests.test_rdutil_detection.test_checksum_none_skips_checksum_stage",
626
+ "eval.tests.test_rdutil_detection.test_checksum_xxh128_is_not_compiled_in",
627
+ "eval.tests.test_rdutil_detection.test_depth_ranking_prefers_shallow_original",
628
+ "eval.tests.test_rdutil_detection.test_deterministic_false_still_detects_duplicates",
629
+ "eval.tests.test_rdutil_detection.test_deterministic_original_follows_argument_order",
630
+ "eval.tests.test_rdutil_detection.test_differs_only_in_last_bytes_not_duplicate",
631
+ "eval.tests.test_rdutil_detection.test_distinct_content_same_size_eliminated_golden",
632
+ "eval.tests.test_rdutil_detection.test_dup_across_two_input_args_outside_tree",
633
+ "eval.tests.test_rdutil_detection.test_dup_at_different_depths_ranks_shallow_original",
634
+ "eval.tests.test_rdutil_detection.test_dup_within_same_arg_is_within_tree",
635
+ "eval.tests.test_rdutil_detection.test_duplicate_by_name_within_one_dir_row_count",
636
+ "eval.tests.test_rdutil_detection.test_empty_directory_reports_zero",
637
+ "eval.tests.test_rdutil_detection.test_first_argument_wins_ranking_keeps_original",
638
+ "eval.tests.test_rdutil_detection.test_first_bytes_stage_disabled",
639
+ "eval.tests.test_rdutil_detection.test_followsymlinks_true_follows_external_symlink",
640
+ "eval.tests.test_rdutil_detection.test_identical_inodes_kept_when_disabled_golden",
641
+ "eval.tests.test_rdutil_detection.test_identical_inodes_removed_by_default_golden",
642
+ "eval.tests.test_rdutil_detection.test_invalid_checksum_rejected",
643
+ "eval.tests.test_rdutil_detection.test_last_bytes_stage_disabled",
644
+ "eval.tests.test_rdutil_detection.test_md5_checksum_stage_used_golden",
645
+ "eval.tests.test_rdutil_detection.test_no_duplicates_reports_zero_golden",
646
+ "eval.tests.test_rdutil_detection.test_same_inode_via_two_args_keeps_zero_rows",
647
+ "eval.tests.test_rdutil_detection.test_saveablespace_is_one_copy_per_dup_group",
648
+ "eval.tests.test_rdutil_detection.test_sha256_checksum_stage_used",
649
+ "eval.tests.test_rdutil_detection.test_sha512_checksum_stage_used_golden",
650
+ "eval.tests.test_rdutil_detection.test_single_duplicate_pair_ranked",
651
+ "eval.tests.test_rdutil_detection.test_symlink_within_tree_not_followed_by_default",
652
+ "eval.tests.test_rdutil_detection.test_three_identical_files_mark_two_dups",
653
+ "eval.tests.test_rdutil_detection.test_three_way_dup_counts_each_group_golden",
654
+ "eval.tests.test_rdutil_options.test_buffersize_negative_rejected",
655
+ "eval.tests.test_rdutil_options.test_buffersize_override_accepted",
656
+ "eval.tests.test_rdutil_options.test_buffersize_too_large_rejected",
657
+ "eval.tests.test_rdutil_options.test_buffersize_zero_rejected",
658
+ "eval.tests.test_rdutil_options.test_h_flag_shows_usage_golden",
659
+ "eval.tests.test_rdutil_options.test_help_flag_shows_usage_golden",
660
+ "eval.tests.test_rdutil_options.test_ignoreempty_false_includes_empties",
661
+ "eval.tests.test_rdutil_options.test_ignoreempty_true_drops_empties_golden",
662
+ "eval.tests.test_rdutil_options.test_maxsize_below_fits_includes",
663
+ "eval.tests.test_rdutil_options.test_maxsize_boundary_excludes_equal_golden",
664
+ "eval.tests.test_rdutil_options.test_maxsize_filters_larger_files_golden",
665
+ "eval.tests.test_rdutil_options.test_minsize_boundary_includes_equal",
666
+ "eval.tests.test_rdutil_options.test_minsize_ignores_smaller_files_golden",
667
+ "eval.tests.test_rdutil_options.test_minsize_maxsize_logical_error",
668
+ "eval.tests.test_rdutil_options.test_minsize_zero_includes_empty",
669
+ "eval.tests.test_rdutil_options.test_negative_minsize_rejected",
670
+ "eval.tests.test_rdutil_options.test_no_args_shows_usage_golden",
671
+ "eval.tests.test_rdutil_options.test_progress_false_no_progress",
672
+ "eval.tests.test_rdutil_options.test_progress_true_output",
673
+ "eval.tests.test_rdutil_options.test_removeidentinode_true_false_changes_inode_handling",
674
+ "eval.tests.test_rdutil_options.test_same_dir_twice_triggers_inode_removal_golden",
675
+ "eval.tests.test_rdutil_options.test_sleep_1ms_accepted",
676
+ "eval.tests.test_rdutil_options.test_sleep_unsupported_value_rejected",
677
+ "eval.tests.test_rdutil_options.test_three_args_priority_column",
678
+ "eval.tests.test_rdutil_options.test_unknown_option_rejected",
679
+ "eval.tests.test_rdutil_options.test_v_short_version_flag_golden",
680
+ "eval.tests.test_rdutil_options.test_version_flag_golden",
681
+ "eval.tests.test_rdutil_results.test_default_results_file_created_with_header",
682
+ "eval.tests.test_rdutil_results.test_makeresultsfile_false_skips_file",
683
+ "eval.tests.test_rdutil_results.test_original_priority_is_cmdline_index",
684
+ "eval.tests.test_rdutil_results.test_outputname_absolute_relative_kept",
685
+ "eval.tests.test_rdutil_results.test_outputname_changes_results_file",
686
+ "eval.tests.test_rdutil_results.test_outputname_in_subdirectory_created",
687
+ "eval.tests.test_rdutil_results.test_results_columns_and_priority",
688
+ "eval.tests.test_rdutil_results.test_results_depth_column_reflects_nesting",
689
+ "eval.tests.test_rdutil_results.test_results_device_and_inode_columns_populated",
690
+ "eval.tests.test_rdutil_results.test_results_file_marks_distinct_groups",
691
+ "eval.tests.test_rdutil_results.test_results_file_overwrites_existing",
692
+ "eval.tests.test_rdutil_results.test_results_header_format",
693
+ "eval.tests.test_rdutil_results.test_results_size_and_duptype_columns",
694
+ "eval.tests.test_rdutil_results.test_unwritable_results_file_aborts",
695
+ "eval.tests.test_rdutil_scanargs.test_nonexistent_path_argument_scans_zero_gracefully",
696
+ "eval.tests.test_rdutil_scanargs.test_regular_file_argument_scanned_as_single_file",
697
+ "eval.tests.test_rdutil_scope.test_broken_symlink_followsymlinks_true_diagnostic",
698
+ "eval.tests.test_rdutil_scope.test_checksum_none_still_writes_results_rows",
699
+ "eval.tests.test_rdutil_scope.test_checksum_sha1_explicit_default_stage",
700
+ "eval.tests.test_rdutil_scope.test_delete_many_duplicates_keeps_one",
701
+ "eval.tests.test_rdutil_scope.test_delete_removes_duplicate_and_keeps_original_remote",
702
+ "eval.tests.test_rdutil_scope.test_hardlink_across_two_tree_arguments",
703
+ "eval.tests.test_rdutil_scope.test_hardlink_many_duplicates_all_share_inode",
704
+ "eval.tests.test_rdutil_scope.test_hardlink_three_args_duplicate_from_third_tree",
705
+ "eval.tests.test_rdutil_scope.test_makeresultsfile_false_ignores_outputname",
706
+ "eval.tests.test_rdutil_scope.test_sleep_supported_values_accepted[100ms]",
707
+ "eval.tests.test_rdutil_scope.test_sleep_supported_values_accepted[10ms]",
708
+ "eval.tests.test_rdutil_scope.test_sleep_supported_values_accepted[1ms]",
709
+ "eval.tests.test_rdutil_scope.test_sleep_supported_values_accepted[25ms]",
710
+ "eval.tests.test_rdutil_scope.test_sleep_supported_values_accepted[50ms]",
711
+ "eval.tests.test_rdutil_scope.test_sleep_unsupported_values_rejected[11ms]",
712
+ "eval.tests.test_rdutil_scope.test_sleep_unsupported_values_rejected[6ms]",
713
+ "eval.tests.test_rdutil_scope.test_sleep_unsupported_values_rejected[7ms]",
714
+ "eval.tests.test_rdutil_scope.test_sleep_unsupported_values_rejected[8ms]",
715
+ "eval.tests.test_rdutil_scope.test_sleep_unsupported_values_rejected[9ms]",
716
+ "eval.tests.test_rdutil_scope.test_symlink_across_two_tree_arguments",
717
+ "eval.tests.test_rdutil_sizes.test_default_sha1_large_total_reads_full_content",
718
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_boundary_1024]",
719
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_boundary_1026]",
720
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_gib]",
721
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_kib_even]",
722
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_kib_roundup]",
723
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_mib]",
724
+ "eval.tests.test_rdutil_sizes.test_large_duplicate_totals_use_binary_prefix[size_tib]"
725
+ ]
726
+ }
727
+ },
728
+ "commit": "e50c817ea28fac58810cbefddd2c5b0551a30b44",
729
+ "data_source": "synthetic_programgym",
730
+ "difficulty": "easy",
731
+ "difficulty_score": 1.463743721247059,
732
+ "eval_clean_hashes": [
733
+ "050fe95a155e7755be6e36410fe75229f86364e59f289ca27e9c551774066072"
734
+ ],
735
+ "input_record": {
736
+ "commit": "e50c817ea28fac58810cbefddd2c5b0551a30b44",
737
+ "difficulty": "easy",
738
+ "difficulty_code_lines": 2909,
739
+ "difficulty_has_tests": false,
740
+ "difficulty_product_code_lines": 2909,
741
+ "difficulty_runtime_deps": 0,
742
+ "difficulty_score": 1.463743721247059,
743
+ "difficulty_test_code_lines": 207,
744
+ "full_name": "pauldreik/rdfind",
745
+ "input_joern_zip": "cpp_joern/pauldreik__rdfind.zip",
746
+ "joern_status": true,
747
+ "joern_time": 5.596034521004185,
748
+ "language": "cpp",
749
+ "pb_match": [
750
+ {
751
+ "pb_fullname": "ip7z/7zip",
752
+ "rank": 368,
753
+ "similarity": 0.41035887598991394
754
+ },
755
+ {
756
+ "pb_fullname": "tstack/lnav",
757
+ "rank": 777,
758
+ "similarity": 0.42981579899787903
759
+ }
760
+ ],
761
+ "repo_path": "cpp/pauldreik__rdfind",
762
+ "source": "commit:e50c817ea28fac58810cbefddd2c5b0551a30b44",
763
+ "status": "done",
764
+ "url": "https://github.com/pauldreik/rdfind"
765
+ },
766
+ "instance_id": "pauldreik__rdfind.e50c817",
767
+ "language": "cpp",
768
+ "module_iterations": [
769
+ {
770
+ "actual_iterations": 4,
771
+ "branch_name": "generated_module_01",
772
+ "iteration_limit": 5,
773
+ "module_index": 1,
774
+ "module_kind": "source",
775
+ "termination_reason": "module_coverage_threshold_reached"
776
+ },
777
+ {
778
+ "actual_iterations": 5,
779
+ "branch_name": "generated_module_02",
780
+ "iteration_limit": 5,
781
+ "module_index": 2,
782
+ "module_kind": "source",
783
+ "termination_reason": "max_iterations"
784
+ },
785
+ {
786
+ "actual_iterations": 4,
787
+ "branch_name": "generated_module_03",
788
+ "iteration_limit": 5,
789
+ "module_index": 3,
790
+ "module_kind": "source",
791
+ "termination_reason": "module_coverage_threshold_reached"
792
+ },
793
+ {
794
+ "actual_iterations": 5,
795
+ "branch_name": "generated_module_04",
796
+ "iteration_limit": 5,
797
+ "module_index": 4,
798
+ "module_kind": "source",
799
+ "termination_reason": "max_iterations"
800
+ }
801
+ ],
802
+ "repository": "pauldreik/rdfind"
803
+ }