pMARS patch set

G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

Hello,

I've some patches for pMARS to fix some bugs and add some
optional features including read/write limit support. They are
available at:

http://www.cs.helsinki.fi/u/jpihlaja/cw/pmars-0.9.2-patches_20040721.tar.gz

The patches are described below. Most patches are independent of
each other, excepting the 02bimmediate.patch and the
07rwlimit.patch that must be applied in that order. If you're
applying all of them, it's best to apply them in the order below,
using a fuzz factor of three or four.

I've not got access to a windows compiler at the moment so can't
make an EXE of these I'm afraid. I'll be adding r/w support to
the server at SAL after my holiday.

Many thanks to Chip Wendell and John Metcalf for noticing these
bugs.

Best Regards,

Joonas Pihlaja


- 01bigbufs.patch:

Increases some internal limits so pMARS won't crash as easily by
accident.

- 02bimmediate.patch:

Fixes a bug when evaluating immediate mode B-operands where the
B-register wasn't reloaded after evaluating the A-operand. This
caused code where the A-operand was <0 or >0, and thus changed
the B-field of the instruction, to be executed wrong.

- 03longmin-alpha.patch:

Fixes a bug in eval.c that caused pMARS to crash on Alpha
processors when dividing LONG_MIN by +1

- 04optA.patch:

Adds an command line switch -A that can be used to assemble only
the input warriors and not run any fights. Emits '94 Draft
compliant load files.

- 05outside_org.patch:

Fixes a bug in sim.c that caused pmars to try to access memory
outside core when given an ORG or END statement with an argument
that was too large.

- 06rc5.patch:

Adds another random number generator with a larger seed space to
make cracking -F numbers harder. If the parameter to the -F
switch contains non-digits then it seeds the new generator, and
otherwise the old generator is used, to maintain compatibility.

- 07rwlimit.patch:

Adds read/write limit support. The implementation follows Chip
Wendell's CoreWin R/W model where the base offset cell in
predecrement and postincrement indirect modes is computed within
the write limit. New switches -R <readlimit> and -W <writelimit>
can be used to set the limits, which must be divisors of
CORESIZE. Also, the predefined symbols READLIMIT and WRITELIMIT
are available for warriors to use during assembly.

Note: compiling in R/W limit support slows down the simulator by
170% even if both the R/W limits are equal to CORESIZE!

Note 2: Consider this one to be in a beta-test phase, as I'm not
100% sure I've got the details exactly right. Just wanted to get
it out the door before dropping off line for a bit.
 
Archived from groups: rec.games.corewar (More info?)

On 2004-07-22, M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> wrote:
>
> I've some patches for pMARS to fix some bugs and add some
> optional features including read/write limit support. They are
> available at:
>
> http://www.cs.helsinki.fi/u/jpihlaja/cw/pmars-0.9.2-patches_20040721.tar.gz

I'm still the official maintainer of the pMARS sourceforge project
(but not the project admin, so I can't transfer the job to someone
else without Anton's help). I'm unfortunately not around much until
mid August or so, so I can't get a new version out before that. But
these patches certainly do seem useful.

Some quick comments below:

> - 02bimmediate.patch:
> Fixes a bug when evaluating immediate mode B-operands where the
> B-register wasn't reloaded after evaluating the A-operand. This
> caused code where the A-operand was <0 or >0, and thus changed
> the B-field of the instruction, to be executed wrong.

If this was in fact a violation of the '94 draft spec, how come nobody
noticed it before? Come to think of it, might there be some warriors
around that depend on this bug?

> - 04optA.patch:
> Adds an command line switch -A that can be used to assemble only
> the input warriors and not run any fights. Emits '94 Draft
> compliant load files.

How is that different from -r 0 (except, I suppose, for the value of
ROUNDS)?

--
Ilmari Karonen
If replying by e-mail, please replace ".invalid" with ".net" in address.
 
Archived from groups: rec.games.corewar (More info?)

M Joonas Pihlaja wrote:

>
> Hello,
>
> I've some patches for pMARS to fix some bugs and add some
> optional features including read/write limit support. They are
> available at:
>
>
http://www.cs.helsinki.fi/u/jpihlaja/cw/pmars-0.9.2-patches_20040721.tar.gz
>
> The patches are described below. Most patches are independent of
> each other, excepting the 02bimmediate.patch and the
> 07rwlimit.patch that must be applied in that order. If you're
> applying all of them, it's best to apply them in the order below,
> using a fuzz factor of three or four.
>
> I've not got access to a windows compiler at the moment so can't
> make an EXE of these I'm afraid. I'll be adding r/w support to
> the server at SAL after my holiday.
>
> Many thanks to Chip Wendell and John Metcalf for noticing these
> bugs.
>
> Best Regards,
>
> Joonas Pihlaja
>
>
> - 01bigbufs.patch:
>
> Increases some internal limits so pMARS won't crash as easily by
> accident.
>
> - 02bimmediate.patch:
>
> Fixes a bug when evaluating immediate mode B-operands where the
> B-register wasn't reloaded after evaluating the A-operand. This
> caused code where the A-operand was <0 or >0, and thus changed
> the B-field of the instruction, to be executed wrong.
>
> - 03longmin-alpha.patch:
>
> Fixes a bug in eval.c that caused pMARS to crash on Alpha
> processors when dividing LONG_MIN by +1
>
> - 04optA.patch:
>
> Adds an command line switch -A that can be used to assemble only
> the input warriors and not run any fights. Emits '94 Draft
> compliant load files.
>
> - 05outside_org.patch:
>
> Fixes a bug in sim.c that caused pmars to try to access memory
> outside core when given an ORG or END statement with an argument
> that was too large.
>
> - 06rc5.patch:
>
> Adds another random number generator with a larger seed space to
> make cracking -F numbers harder. If the parameter to the -F
> switch contains non-digits then it seeds the new generator, and
> otherwise the old generator is used, to maintain compatibility.
>
> - 07rwlimit.patch:
> ,
> Adds read/write limit support. The implementation follows Chip
> Wendell's CoreWin R/W model where the base offset cell in
> predecrement and postincrement indirect modes is computed within
> the write limit. New switches -R <readlimit> and -W <writelimit>
> can be used to set the limits, which must be divisors of
> CORESIZE. Also, the predefined symbols READLIMIT and WRITELIMIT
> are available for warriors to use during assembly.
>
> Note: compiling in R/W limit support slows down the simulator by
> 170% even if both the R/W limits are equal to CORESIZE!
>
> Note 2: Consider this one to be in a beta-test phase, as I'm not
> 100% sure I've got the details exactly right. Just wanted to get
> it out the door before dropping off line for a bit.

I think one thing is missing. If you let fight one Warrior alone, and he
survives without selfdestruction he should win. But pmars output is 0 0,
For example exmars, means exhaust puts out 1 0

Sascha

--
Parlez vous Redcode?