Skip to content

fix(eval): copy preset list to prevent aliasing mutation#32

Merged
sacredvoid merged 1 commit intomainfrom
fix/eval-preset-list-aliasing
Mar 26, 2026
Merged

fix(eval): copy preset list to prevent aliasing mutation#32
sacredvoid merged 1 commit intomainfrom
fix/eval-preset-list-aliasing

Conversation

@sacredvoid
Copy link
Owner

Summary

  • Wraps BENCHMARK_PRESETS[key] in list() to create a copy instead of aliasing the shared dict
  • Previously, config.tasks.append("x") permanently corrupted the preset for all future configs

Fixes #31

Test plan

  • New test: test_preset_tasks_not_aliased_to_shared_dict
  • All 179 tests pass, lint/format clean

The preset resolver assigned BENCHMARK_PRESETS[key] directly to
self.tasks, so mutating config.tasks corrupted the shared preset
dict for all future configs in the same process. Now copies with
list().

Fixes #31
@sacredvoid sacredvoid merged commit c97497d into main Mar 26, 2026
@sacredvoid sacredvoid deleted the fix/eval-preset-list-aliasing branch March 26, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: EvalConfig preset resolver aliases shared list, mutation corrupts BENCHMARK_PRESETS

1 participant