Skip to content

Conversation

@mihaip
Copy link
Contributor

@mihaip mihaip commented Nov 10, 2024

Adds support for a --deterministic command-line option that makes repeated runs the same:

  • Keyboard and mouse input is ignored
  • The sound server does a periodic pull from the DMA channel (so that it gets drained), but only does so via a periodic timer (instead of being driven by a cubeb callback, which could arrive at different times)
  • Disk image writes are disabled (reads of a modified area still work via an in-memory copy)
  • NVRAM writes are disabled
  • The current time that ViaCuda initializes the guest OS is always the same.

This makes execution exactly the same each time, which should make debugging of more subtle issues easier.

To validate that the deterministic mode is working, I've added a periodic log of the current "time" (measured in cycle count), PC and opcode. When comparing two runs with --log-no-uptime, the generated log files are identical.

Adds support for a --deterministic command-line option that makes
repeated runs the same:
- Keyboard and mouse input is ignored
- The sound server does a periodic pull from the DMA channel (so that
  it gets drained), but only does so via a periodic timer (instead of
  being driven by a cubeb callback, which could arrive at different
  times)
- Disk image writes are disabled (reads of a modified area still
  work via an in-memory copy)
- NVRAM writes are disabled
- The current time that ViaCuda initializes the guest OS is always the
  same.

This makes execution exactly the same each time, which should
make debugging of more subtle issues easier.

To validate that the deterministic mode is working, I've added a
periodic log of the current "time" (measured in cycle count), PC
and opcode. When comparing two runs with --log-no-uptime, the generated
log files are identical.
@mihaip mihaip force-pushed the upstream-deterministic branch from d206030 to f65f9b9 Compare November 10, 2024 06:48
@dingusdev dingusdev merged commit 42f1871 into dingusdev:master Nov 10, 2024
5 checks passed
@mihaip mihaip deleted the upstream-deterministic branch November 10, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants