Skip to content

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

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.

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