Repository navigation
Conversation
MaxXSoft
commented
Oct 20, 2026
Owner
- Coauthored by: GPT-6 Astra
- Reviewed by: MaxXing
There was a problem hiding this comment.
🟢 Approval recommended
Static review and the reported standalone stack-model check found no blocking issues; project simulations were not run.
No open issues 🎉
What changed in this PR
Adds a speculative 16-entry return-address stack to improve return prediction alongside the existing branch predictor.
Changes:
- Recognizes standard and compressed call/return hints, with backend-flush recovery.
- Adds stack, predictor, fetch, and core integration tests to CI.
- Documents RAS behavior and consolidates instruction constants.
| File | Description |
|---|---|
| src/test/scala/core/stages/FetchRasTest.scala | Tests stalls, nested returns, flushes, and faults. |
| src/test/scala/core/integration/CoreRasTest.scala | Tests return prediction and retirement under stalls. |
| src/test/scala/bpu/ReturnAddressStackTest.scala | Tests stack boundaries and randomized operations. |
| src/test/scala/bpu/RasPredictionTest.scala | Tests instruction hints and prediction fallback. |
| src/test/scala/bpu/DecoderTrainingTest.scala | Initializes new predictor inputs. |
| src/test/scala/bpu/BranchPredictorTest.scala | Initializes new predictor inputs. |
| src/main/scala/core/Fetch.scala | Connects instruction acceptance and flush signals. |
| src/main/scala/core/Decoder.scala | Adds whitespace only. |
| src/main/scala/core/CompressedDecoder.scala | Uses shared constants and explicit opcodes. |
| src/main/scala/consts/Parameters.scala | Defines RAS capacity. |
| src/main/scala/consts/Instructions.scala | Adds a shared EBREAK encoding. |
| src/main/scala/bpu/ReturnAddressStack.scala | Implements the bounded speculative stack. |
| src/main/scala/bpu/BranchPredictor.scala | Adds call/return predecode and RAS prediction. |
| README.md | Documents RAS behavior and recovery limitations. |
| CHANGELOG.md | Records the RAS addition. |
| .github/workflows/test.yml | Runs the new regression tests. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.