Add SAC with discrete actions as a new learning algorithm.
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
Add SAC with discrete actions as a new learning algorithm.
Assistant
I'll add SAC-Discrete as a configurable learning algorithm.
Assistant
Now let me look at the core implementation files — the Learner, the experience buffer, GAE, and models.
Assistant
Let me look at the remaining infrastructure — GAE, ExperienceBuffer, PolicyVersionManager, the example main, and the tests.
Assistant
Now let me check the tests, example code, and build configuration.
Assistant
I now have a good picture of the codebase. Let me check the remaining pieces — Framework.h macros, setup scripts, CI workflow — and then update the scratchpad with a plan.
Assistant
Scratchpad updated. Now let me create the branch and start the refactor while libtorch downloads.
Assistant
While libtorch downloads, let me check a few utility APIs I'll need, then start writing code.
Assistant
Now the shared policy inference module.
Assistant
Now the AlgoLearner base interface.
Assistant
Now update PPOLearner to derive from AlgoLearner and use the shared inference module.
Assistant
Now update the InferUnit and PolicyVersionManager call sites.
Assistant
Now update PolicyVersionManager to work with the AlgoLearner interface.
Assistant
Now update the test call sites.
Assistant
Refactor call sites are done. Now the ReplayBuffer for SAC.
Assistant
Now the public SAC configuration header.
Assistant
Now the SACLearner implementation.
Assistant
Now let me integrate SAC into the Learner. First the config header.
Assistant
Now the big one — Learner.cpp. Start with the constructor and includes.
Assistant
Now the SaveStats/LoadStats algorithm tag, and Save/Load using the interface.
Assistant
Now the runtime setters/getters.
Assistant
Now the transfer-learn guard and its model construction.
Assistant
Now the main training loop. Let me update it piece by piece, starting with the guards and setup.
Assistant
Now add next-action-mask capture at both truncation points.
Assistant
Now the inference calls in the collection loop.
Assistant
Now let me update the rest of the loop — version manager call and the per-algorithm display list.
Assistant
Let me make the replay buffer a
unique_ptrto avoid the manual delete on the return path.Assistant
Now update the tests CMakeLists to compile the new sources, and check on the libtorch download.
Assistant
Direct pytorch.org downloads are blocked at the TLS level (the CDN redirect target
download-r2.pytorch.orgfails), butanaconda.orgworks. Let me get a CPU libtorch from conda-forge via micromamba.Assistant
While libtorch installs, let me write the replay buffer unit tests.
Assistant
Now the SAC unit tests.
Assistant
Toolchain is ready. Let me check the top-level CMake and configure the build.
Assistant
Build succeeded. Let me run the unit tests (the integration test needs a rebuild with my new SAC phases).
Assistant
All 73 unit tests pass (59 before, 14 new). Let me check that build warning, then run the integration test.
Assistant
That warning is pre-existing vendored RocketSim code. Now the full integration test.
Assistant
Integration test passes with all SAC phases. Let me commit this working state, then run a real learning smoke test.
Assistant
The conda env got staged — let me unstage it and gitignore it.
Assistant
Now let me set up a real SAC learning smoke run. Check the test-mesh tool first.
Assistant
The SAC run is training at ~15k steps/s with healthy metrics. While it runs to 2M steps, let me write the docs. First check the existing style.
Assistant
The 2M-step run finished cleanly. Let me check the learning trend across the run.
Assistant
Now the ExampleMain SAC snippet and a TROUBLESHOOTING entry.
Assistant
Clean build. The refactored version-manager/skill-tracker path isn't covered by the integration test, so let me verify it live with both algorithms.
Assistant
All green. Let me add an explicit
<memory>include for theunique_ptr(portability), then commit.Assistant
CI is running on all three platforms. While it runs, let me do a careful self-review of the full diff.
Assistant
The review found a few real issues. Let me fix them: extract the transition-building into a testable static, re-freeze target params after load, and persist the gradient-step counter.
Assistant
Now update SaveTo/LoadFrom for the named-archive state and target re-freezing.
Assistant
Now simplify Learner.cpp to use the extracted function.
Assistant
Now the doc updates for the review findings (state file name, masked-entropy note).
Assistant
CI passed on all three platforms for the earlier commits; the latest push triggered a new run. Let me monitor it.
Assistant
All three CI jobs pass on the final commit. Let me finish the scratchpad bookkeeping and update the PR body.
Assistant
Let me do a final verification of the repo state and the trailing CI run.
Assistant