-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test warrior gives different result from pMARS #42
Comments
From #41: Trace of test warrior up to end of test code execution, comparison between pMARS and hMARS:
|
From #41: After that SNE executes, the process falls right into a DAT in both cases, pMARS simply ignores it. However, that -2/3 does make a difference. Even though it doesn't alter the course of execution, when the counter process reaches zero and a parity check is performed, the result is different, giving a different round outcome. |
Confirmed on master |
This warrior was simulated by hand (read: I simulated). The second execution of Right before the problematic instruction, Another possibility is that P-space position 0 contains 0 rather than -1 in the first round under pMARS. Here's the modified section of the final warrior state after the test process terminates (differences when P-space position 0 is 0 are indicated):
Overall, the course of execution is in agreement with hMARS. |
This testcase:
shows that pMARS also gets -1 from P-space location 0. Here's a theory:
|
Eureka!
Watch this warrior overwrite P-space location 0 with garbage on pMARS! Wasn't it read-only? hMARS treats it differently just to ensure its unwritability. Edit: actually it's to keep that location separate from other warriors that share a P-space via |
Thus seems like the cell should be read/write. There is an error in the Beginners' guide to Redcode, from which the P-space behavior was clarified (due to the standard not stating anything). Will post on the newsgroup for assistance... |
Added a switch, `PSPACE0_READ_ONLY`, to get the previous behavior. Must still change JIT behavior to respond to the same switch.
Now the self-test fails in the first phase because Classic and JIT do not behave the same. Will have to port these two Classic-only changes to JIT (the first change didn't affect single-round tournaments, so it doesn't affect the testcase; also should add a multi-round testcase). |
Now we're passing the pMARS testcase for the first time! |
This warrior loses on pMARS, ties on hMARS on the first round. Could be P-space-related. See #41.
The text was updated successfully, but these errors were encountered: