Skip to content

MsPacMan Mods and PQN Eval + Video-gen bugfix - #321

Open
DimiM99 wants to merge 6 commits into
k4ntz:devfrom
DimiM99:mspacman-DMBV
Open

MsPacMan Mods and PQN Eval + Video-gen bugfix#321
DimiM99 wants to merge 6 commits into
k4ntz:devfrom
DimiM99:mspacman-DMBV

Conversation

@DimiM99

@DimiM99 DimiM99 commented Jul 14, 2026

Copy link
Copy Markdown

This PR focuses on adding the following:

  • mods for MsPacMan jaxtari implementation
  • PQN Eval on the mods
  • small bug-fix that prevented proper train/eval and lead to video recordings being fully stuck. (will be fixed in different PR)

@DimiM99

DimiM99 commented Jul 15, 2026

Copy link
Copy Markdown
Author

The CI pipeline fail is expected since I applied a fix in the pqn_agent.py where pixel observations get normalized twice during final-video generation. So comparing it with train setup:
pqn_agent.py:161-199 (training, apply_wrappers) only applies NormalizeObservationWrapper inside the OBJECT_CENTRIC branch — the pixel branch never gets it, because QNetwork already does its own x = x / 255.0 internally for pixel observations.
pqn_agent.py:571-583 (_generate_single_final_video, used for every video/eval at the end of a run) applies NormalizeObservationWrapper unconditionally, after the if/else — so for the pixel config it runs on top of the pixel branch too.

So we get a ~255x shrink in the actual visual signal relative to what the CNN's weights expect. The conv/dense biases end up dominating the (nearly-zero) image-dependent signal, so the Q-values become almost independent of what's actually on screen, we could see that in the final video (before fix) where mspacman does nothing and get's stuck.

P.S pining other group member: @benninho21

@DimiM99

DimiM99 commented Jul 15, 2026

Copy link
Copy Markdown
Author

Guess? generate_test_report.py line 34-36:
test_outcomes_str "{}" default only kicks in if the env var TEST_OUTCOMES is unset. And everything goes to the fan after that, we'd need:

     test_outcomes_str = os.environ.get("TEST_OUTCOMES", "{}")
-    test_outcomes = json.loads(test_outcomes_str)
+    test_outcomes = json.loads(test_outcomes_str) or {}
     tests_success = all(outcome == "success" for outcome in test_outcomes.values())

@DimiM99

DimiM99 commented Jul 15, 2026

Copy link
Copy Markdown
Author

Guess? generate_test_report.py line 34-36: test_outcomes_str "{}" default only kicks in if the env var TEST_OUTCOMES is unset. And everything goes to the fan after that, we'd need:

     test_outcomes_str = os.environ.get("TEST_OUTCOMES", "{}")
-    test_outcomes = json.loads(test_outcomes_str)
+    test_outcomes = json.loads(test_outcomes_str) or {}
     tests_success = all(outcome == "success" for outcome in test_outcomes.values())

@sebiwtt mind having a look?

@DimiM99

DimiM99 commented Jul 19, 2026

Copy link
Copy Markdown
Author

@PaulSeitz, i think the output var name in the pipeline is different from the one used as input by the report stage. trigger / collect-results sets 'test_outcome' but report wants 'test_outcomes', mind having a look?

@github-actions

Copy link
Copy Markdown

Test Report

This comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here:

https://github.com/k4ntz/JAXAtari/actions/runs/29508355807

Base Branch ✅

The PR's base branch is dev.
The expected base branch is dev.

Changed Files ✅

There are no forbidden file changes. Nice 👍

Framework Tests ✅

All framework tests passed. Good work! 🎉


This log was automatically created at 2026-07-20 11:38:32 UTC.

@PaulSeitz

Copy link
Copy Markdown
Collaborator

@PaulSeitz, i think the output var name in the pipeline is different from the one used as input by the report stage. trigger / collect-results sets 'test_outcome' but report wants 'test_outcomes', mind having a look?

Yeah something like that crashed the pipeline if there were no changes to specific environments. Should be fixed on dev now, in the re-run the tests show end state 'successful' now.

Regarding your pqn changes, I think someone in our group found this bug as well and I expect them to push the change to the dev branch soon. So you dont have to include it in your PR here but until its on dev you can use your fixed version locally, I checked the state you had commited here earlier and its correct. The normalization wrapper application after the if/else is the incorrect way to do it.

And the implementation of the mods look good as well :)

@DimiM99

DimiM99 commented Jul 20, 2026

Copy link
Copy Markdown
Author

@PaulSeitz, i think the output var name in the pipeline is different from the one used as input by the report stage. trigger / collect-results sets 'test_outcome' but report wants 'test_outcomes', mind having a look?

Yeah something like that crashed the pipeline if there were no changes to specific environments. Should be fixed on dev now, in the re-run the tests show end state 'successful' now.

Regarding your pqn changes, I think someone in our group found this bug as well and I expect them to push the change to the dev branch soon. So you dont have to include it in your PR here but until its on dev you can use your fixed version locally, I checked the state you had commited here earlier and its correct. The normalization wrapper application after the if/else is the incorrect way to do it.

And the implementation of the mods look good as well :)

Sweet, thanks. Yeah we did run all the tests with the fixes in-place (otherwise Wandb made no sense) and I dropped the commits with the fixes since that'll probably be topic for another PR. I guess otherwise this can be merged? It seems I'm not able to add Reviewers or Assignees to this PR.

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.

2 participants