Skip to content

✨ Add opt-in GNN features to the RL predictor - #800

Draft
flowerthrower wants to merge 5 commits into
v3/670-intermediate-rewardsfrom
v3/669-gnn-rl
Draft

flowerthrower wants to merge 5 commits into
v3/670-intermediate-rewardsfrom
v3/669-gnn-rl

Conversation

@flowerthrower

@flowerthrower flowerthrower commented Aug 27, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

Adds opt-in GNN circuit embeddings to the RL predictor while leaving PredictorEnv and the default flat MaskablePPO path unchanged.

The implementation preserves the prototype's ordered 52-dimensional node features, ordered 36-dimensional global features, GraphSAGE/attention/shared-trunk topology, separate encoder and policy learning rates, and tuned paper configuration. Seeding follows #797's opt-in contract instead of injecting an implicit seed.

Exact variable-sized PyG graph sidecars pass through a focused rollout buffer and narrow collect_rollouts specialization. Masking, callbacks, numeric rollout state, GAE, PPO training, logging, and .zip serialization remain in SB3; graphs are not padded or truncated.

Torch Geometric remains optional through mqt.predictor[gnn], requiring torch-geometric>=2.7.0 on Python below 3.14 and torch-geometric>=2.8.0 on Python 3.14 or newer. This PR also raises the minimum sb3_contrib version from 2.0.0 to 2.3.0. The prototype checkpoint is not migrated because its action-output schema differs from this stack.

This is position 9 and the top of the stack. It depends on #799. No GNN-specific automated tests are included; external documentation and a dedicated test suite are deferred as requested.

Fixes #669

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@flowerthrower flowerthrower added enhancement New feature or request major Part of a major release labels Aug 27, 2026
@flowerthrower flowerthrower self-assigned this Aug 27, 2026
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch from 720a29b to a25d10f Compare August 27, 2026 14:46
@flowerthrower
flowerthrower force-pushed the v3/669-gnn-rl branch 2 times, most recently from 913bc47 to c0a77ad Compare August 27, 2026 15:02
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch from a25d10f to 21e573a Compare August 27, 2026 15:02
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.64516% with 351 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mqt/predictor/rl/gnn.py 0.0% 337 Missing ⚠️
src/mqt/predictor/rl/predictor.py 60.0% 14 Missing ⚠️

📢 Thoughts on this report? Let us know!

@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch from 1fbe20f to 3905e40 Compare August 28, 2026 07:33
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch from 3905e40 to 462ea5c Compare August 28, 2026 07:52
@flowerthrower
flowerthrower force-pushed the v3/669-gnn-rl branch 2 times, most recently from 5fc94fd to bf56ee3 Compare August 28, 2026 08:13
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch 2 times, most recently from 894d842 to 04224ef Compare August 28, 2026 08:30
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch from 04224ef to 071e46c Compare August 28, 2026 09:57
@flowerthrower
flowerthrower force-pushed the v3/669-gnn-rl branch 2 times, most recently from 317553b to c8fc8df Compare August 28, 2026 10:05
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch 2 times, most recently from 27372b1 to 8c2a30f Compare August 28, 2026 10:18
flowerthrower and others added 5 commits August 28, 2026 12:29
Co-authored-by: Antonio Tudisco <anto.tu98@hotmail.it>

Signed-off-by: flowerthrower <flowerthrower@users.noreply.github.com>
Assisted-by: GPT 5.6 via Codex
Signed-off-by: flowerthrower <flowerthrower@users.noreply.github.com>
Assisted-by: GPT 5.6 via Codex
Signed-off-by: flowerthrower <flowerthrower@users.noreply.github.com>
Assisted-by: GPT 5.6 via Codex
Signed-off-by: flowerthrower <flowerthrower@users.noreply.github.com>
Assisted-by: GPT 5.6 via Codex
@flowerthrower
flowerthrower force-pushed the v3/670-intermediate-rewards branch from 8c2a30f to 623b4ab Compare August 28, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request major Part of a major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant