Skip to content

Conversation

@kasanari
Copy link
Collaborator

To avoid accidental leakages of statefulness.

Should also make it easier to define custom reward functions.

@kasanari kasanari requested a review from mrkickling December 18, 2025 17:10
@mrkickling mrkickling marked this pull request as draft December 19, 2025 10:12
@mrkickling
Copy link
Contributor

Made this a draft before the pipeline checks suceeed.

  • Run ruff format and ruff check to fix ruff issues
  • fix mypy issues
malsim/mal_simulator/rewards.py:6: error: Incompatible import of "Generator" (imported name has type "type[numpy.random._generator.Generator]", local name has type "type[typing.Generator[_YieldT_co, _SendT_contra, _ReturnT_co]]")  [assignment]
malsim/mal_simulator/rewards.py:50: error: Missing type parameters for generic type "Generator"  [type-arg]
malsim/mal_simulator/rewards.py:78: error: Argument 1 to "sample_value" of "TTCDist" has incompatible type "typing.Generator[Any, None, None]"; expected "numpy.random._generator.Generator | None"  [arg-type]
malsim/mal_simulator/simulator.py:124: error: Argument "rng" to "attacker_step_reward" has incompatible type "numpy.random._generator.Generator"; expected "typing.Generator[Any, None, None]"  [arg-type]
  • pytests failing (maybe something changed in how the reward is calculated?)

@kasanari
Copy link
Collaborator Author

kasanari commented Dec 19, 2025

I ran ruff, there is a commit for it. (Update I ran the wrong ruff)

The tests are failing on the master as well. (I get them to pass now, so I may have ran something wrong. I will check the failing tests.)

@mrkickling
Copy link
Contributor

I'll take a look.

@mrkickling
Copy link
Contributor

Tests now passing on main using latest mal-toolbox. Try rebasing and you should see which tests started failing in this PR.

@kasanari
Copy link
Collaborator Author

This PR is also outdated since I realized the reward functions were not behaving as I expected.

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.

3 participants