Showing posts with label nano. Show all posts
Showing posts with label nano. Show all posts

Monday, 6 July 2009

A New Arms Race, the Tiny Evolvers

A new Corewar arms race is in progress, the battle to create the smallest effective Corewar evolver. There are currently two contenders:
  • Terry Newton: Terry is the evolver guru having previously written three evolvers, Fizzle, REBS and Redmaker. Terry has three new tiny evolvers, JB, SEWAX and LCE. At least two of these have produced nano warriors that entered the hill.
  • John Metcalf: John is a hand-coder who recently got tempted by the dark side of Corewar! John has published two versions of his tiny Corewar evolver, TEV. Both TEV0 and TEV12 have created warriors which entered the nano hill.
Right now, I'm wondering if anyone will break the 1K barrier and if so, who :)

Friday, 13 March 2009

nano papers: ghoulish and Apis Mellifera

Here are a couple of nano paper/clear I've been playing with recently using a mov.i #1,<1 anti-imp clear.

;redcode-nano
;name ghoulish
;author S.Fernandes
;strategy paper/clear
;assert CORESIZE == 80

pstep equ -39
cpos equ -18
dpos equ 27

paper spl #-21 , <-32
mov }paper-1 , }pboot
mov.i #1 , <1
pboot spl <pstep , cpos
djn.f paper+1 , <dpos
end


;redcode-nano
;name Apis Mellifera
;author S.Fernandes
;strategy paper/clear
;assert CORESIZE == 80

pstep equ -22
cpos equ -18
dpos equ -8

paper spl #0 , <33
mov }paper , }pboot
pboot spl <pstep , <-16
mov.i #1 , <1
djn paper+1 , #dpos
end

Wednesday, 19 November 2008

nanoWarrior #03

nanoWarrior - incredibly small corewarThe latest issue of nanoWarrior has finally been completed, containing articles by John Metcalf, German Labarga and me. Check it out for yourself here:

Tuesday, 11 September 2007

ripples in space-time

While looking through the breakdown of nano warriors by strategy I
noticed the absence of a decent 4 line paper, despite the success of
5-liners like Fluffy's Black Sun III. I quickly hacked something up
and added a quick-bomb to the beginning.


I tested with some hand-picked constants against Metcalf's nano
benchmark. It scored 139.2, or 129.8 with the quick-bomb removed.



;redcode-nano
;name hand coded paper
;author S.Fernandes
;strategy paper
;assert CORESIZE == 80

pstep equ 15
ipos equ 40
cpos equ -5
dpos equ 35

mov >60 , 10
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end

Optimization


In the first round of optimization 400 warriors are generated with
all constants randomized. A small script is run over the source
below replacing each exclamation mark with a random number. The
quick-bomb will be disabled until the final stage.



org paper

pstep equ (4+!%73) ; range 4-76
ipos equ (2+!%70) ; range 2-71
cpos equ (8+!%70) ; range 8-77
dpos equ (7+!%70) ; range 7-76

mov >27 , 54
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end

I've use modulo to restrict the range of random values to prevent
self-bombing. This reduces the search space by approximately 40%.
While this may stop some interesting self-mutation or interaction
being found, it's really the author's job not the optimizer's to
discover these.


The peak score is 139.5. Now we take a closer look at the top 10
results to compare the paper step. -17 occurs four times, -18 twice
and -15, -22, -25 and 33 once.


For stage 2 we generate 100 warriors for each of the above paper
steps with all other constants randomized. The peak score is 145.8
with pstep -22 followed by 145.0 with pstep -17.


The top two warriors from stage 2 are taken and their cpos
optimized in stage 3. All 70 values are tested for each warrior.
The peak score for the warrior with pstep -22 remains at
145.8. The score for the warrior with pstep -17 improves
to 145.7.


In stage 4 we take the top warrior for each pstep from
stage 3 and optimize dpos. The scores increase to 146.2
(pstep -22) and 145.8 (pstep -17).


In stage 5 we optimize ipos. The scores go up to 146.8
(pstep -22) and 149.2 (pstep -17).


Finally the quick-bomb is enabled and its two constants optimized.
400 random pair of quick-bomb constants are generated. The final
benchmark scores are 158.3 (pstep -22) and 159.2
(pstep -17).


Submission to SAL's Nano Hill


Although the benchmark scores are impressive, the hill contains 50
completely different warriors. If the benchmark reflects the hill
well, the scores should be within 10%.


The paper with pstep -22 scores 146.2 and takes 6th
place. With pstep -17 however the score is 152.3 and 4th
place.



;redcode-nano
;name ripples in space-time
;author S.Fernandes
;strategy paper
;assert CORESIZE == 80

pstep equ -17
ipos equ 10
cpos equ -33
dpos equ 36

mov >-39 , 25
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end


;redcode-nano
;name ripples 22
;author S.Fernandes
;strategy paper
;assert CORESIZE == 80

pstep equ -22
ipos equ -34
cpos equ 17
dpos equ -29

mov >-38 , 25
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end

Thursday, 19 July 2007

nanoWarrior #02 (finally!)

Finally, the latest issue of nanoWarrior is complete! Check it out for yourself here:

http://corewar.co.uk/nw02.txt