Skip to content

Possible nondeterminism (and a note about .gitignore) #1

Open

Description

@fulmond682

Hi, thanks for sharing your gem5 implementation.

I noticed a few issues that might affect reproducibility:

1: .gitignore is missing m5out/ You committed simulation output binaries. This makes the repo unnecessarily large and pollutes the commit history.
2: Non‑deterministic protocol behavior The actual source of non‑determinism is in BankedArray.cc, which uses rand() seeded by microseconds to resolve bank conflicts. This affects any protocol that uses BankedArray (including both MESI_Two_Level and MESI_Two_Level_Trace). Switching to _Trace doesn't introduce the problem it just inherits it from the underlying banked array.

To fix reproducibility, you would need to replace the rand() in BankedArray.cc with a deterministic pseudo‑RNG seeded by the tick count or a fixed value. Alternatively, if you only need deterministic ordering for your experiments, u can modify BankedArray.cc to use a simple sequential or round‑robin policy instead of random selection.

Activity

  1. harrylee365 commented on May 17, 2026

    @harrylee365
    Owner

    @fulmond682 Thanks for letting me know the problem, I will fix the problem once I have a chance to look on it.

  2. changed the title [-]Possible nondeterminism in MESI_Two_Level_Trace (and a note about .gitignore)[/-] [+]Possible nondeterminism (and a note about .gitignore)[/+] on May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions