Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Test suite?

65 views
Skip to first unread message

mic...@lazerwalker.com

unread,
Apr 30, 2017, 7:45:15 AM4/30/17
to
Hi all!

I'm working on a MARS interpreter/simulator as a hobby project. I _believe_ the thing I've written is a faithful implementation of the spec, but that's naturally difficult to verify as a relative newcomer to the scene.

For folks who have written their own alternative MARS software, what approaches have you taken to verify that it works as expected? More concretely, is there sort of test suite for conformance to the spec, or even e.g. a set of test warriors with known expected output given a specific core size and initial set of memory positions.

I'm sure I could throw together such a thing myself, but, again, not being a hardcore player myself I suspect there are edge cases I'd likely unintentionally exclude or misrepresent.

(I'm most interested in '88, but I expect such a thing is perhaps more likely to exist for '94)

Thanks!
-Mike

John Metcalf

unread,
May 1, 2017, 4:42:32 AM5/1/17
to
Hi Mike,

There's a validation program for CWS'88 Redcode which might help:

http://para.inria.fr/~doligez/corewar/post/Validate1.1R.txt

Good luck,

John

skybu...@hotmail.com

unread,
May 20, 2017, 3:42:16 PM5/20/17
to
Hi

For today I am short on time, so maybe tomorrow I will look into it more deeply/further.

For now from what I can remember I did it in two steps:

1. I modified pmars so that it's entire memory contents can be dumped to files, this source code and binaries is here:

http://members.home.nl/hbthouppermans/Tools/PMARS/

(I myself have 3 versions higher than the one on this weblink not sure why... maybe there was some kind of output bug or shortcoming or maybe new version had some new feature not sure, for now you can try it out.)

2. I generated basically all permutations/combinations of a single instructions or something like that, and ran it in pmars, then outputted everything, then loaded that into my own executor and compared the entire memory contents to see if it was the same.

This process uncovered some interesting bugs/deviances like post/pre addressing modes and such... I kinda preferred my own interpretation, but eventually decided to go for 100% compliance ;)

The test programs/test suit was automatically generated probably by some delphi program I wrote.... can't find it right now immediately... tomorrow I will look further into it.

Now some questions for you:

1. What programming language did you write it in ?

2. What do you plan to use it for ?

Bye,
Skybuck.

P.S.:

Here you can admire my executor :)

http://www.skybuck.org/Corewars/SkybucksCorewarsSimulator/


I never completed finished the GUI to include everything... but the executor itself is 100% complete as far as I am concerned... expect weird features like spacing of warriors or something odd like that... and no assembler/compiler... so pmars is used for compiling... once it's compiled... the binary is executed by the internal executors for speed.

I also added a nice soundalizer to it which is kinda cool.

You may want to google my name and redcode and corewars and executor and such because I wrote a lot of stuff back then in 2009 about it.

Even did a cool extension which I never really used to evolve stuff.

I kinda got scared seeing how fast warriors started evolving so I stopped with that for now =D

Maybe some day I will continue, but first I need a new PC for more horse power !

If only the DAMNED intel and DAMNED AMD wouldn't make such buggy chips ! ;)

Perhaps the new AMD threadripper might offer some hope of building a new quality PC ! ;)
0 new messages