Page 1 of 2

Flash Flood

Posted: Thu Sep 25, 2008 9:26 pm
by gfoot
It would be nice if errors like "failed to flood correctly" were accompanied by the source data that the algorithm failed on. Not only does it give something more direct to fix, it also lets you check that you're interpreting the source data in the right way.

I'm assuming that an out-of-cycles error would be reported differently already.

Posted: Thu Sep 25, 2008 9:58 pm
by gfoot
Hmm, it's now just telling me that my program text is incorrect, even when it's the same program that it previously reported had failed to fill properly. Is it possible that something is wrong with the server? I wouldn't generally expect different results for the same submission.

Posted: Fri Sep 26, 2008 3:40 pm
by MerickOWA
gfoot wrote:Hmm, it's now just telling me that my program text is incorrect, even when it's the same program that it previously reported had failed to fill properly. Is it possible that something is wrong with the server? I wouldn't generally expect different results for the same submission.
If you used any no-op space instructions, it could be an extra space added to the beginning/middle of your program code which throws the instruction addresses off by one.

It also depends on the tests. If the tests are randomly generated, it could be that in some tests, your program fails to fill correctly but doesn't go over the instruction limit. On other tests, your program takes too long and thus is reported as being an 'incorrect program'.

Posted: Fri Sep 26, 2008 5:52 pm
by adum
for this particular challenge, there's only one test case, so giving away where it fails would be too revealing.

adum

Posted: Sat Sep 27, 2008 3:59 pm
by gfoot
OK. In that case I'm confused about my program not working - it's the same algorithm I used for Deluge and another related challenge, with minor changes to support different sizes, and it worked fine on differently sized grids there - plus all my test cases pass, so perhaps I've got the input format wrong.

Could you please confirm that:
* The board is 18x18, stored in the first 324 memory locations, one row at a time, and we're meant to flood-fill from memory location 0. (Maybe my Deluge algorithm was wrong, but fluked it...)
* We're meant to fill zero locations with ones, as before
* If the program hits the cycle count, the error is explicit
* What does it mean if it just says "'XXX' is incorrect", quoting my program text? It's a different error to when it just failed to fill the space.

Experimenting a little, infinite loops seem to either result in the error I saw, or the page coming back without either an error or a restatement of the problem as usual. It's odd that it's inconsistent, and it would help a great deal if it gave an explicit error message when you exceed the cycle count.

Posted: Mon Sep 29, 2008 12:51 am
by adum
let me look into this and get back to you...

but yeah, board is as you say. everything the same as the last one basically except the size.

adum

Posted: Tue Dec 02, 2008 11:15 pm
by adum
to get back to your questions, the board is laid out the same as before, in the first 324 memory locations. the thing here is that Flash Flood just always says incorrect no matter what your error is. ie, cycle count being too high is the same as failing to flood, is the same as the program terminating on error.

i just reran my solution, it still works. the problem is good =)

i think the only way to code this is to first verify that your code works offline on your own memory set, where you can see how many cycles it's using and make sure it floods correctly.

Posted: Wed Dec 03, 2008 12:59 am
by gfoot
OK - my program solves the new warm-up challenge without modification. I guess it just runs out of cycles on the original challenge. It would sill be nice to know how far over budget it is, somehow. Is the warm-up data comparable in complexity?

I see tails has solved Flash Flood now anyway, so it's obviously possible by mere mortals, even without feedback. :)

Posted: Wed Dec 03, 2008 1:02 am
by adum
i found my own algo ran about 10% faster on the warmup, but results may vary.

Posted: Wed Dec 03, 2008 1:25 am
by tails
Hi,

Actually I made my code in July, but I was hesitating about posting it, because it exceeds the cycle limit in some cases in my local test. I was thinking my code needed more improvement.

My code solves the Warmup one in 16004 cycles. I think I can reduce the cycles more, but it will be a pain to do it, because of the size and speed tradeoff. My code has already grown up to 1311 instructions long!

EDIT: "have been" -> "was". Sorry for my poor English.

Posted: Wed Dec 03, 2008 6:40 am
by Skeeve
How many cycles can be used on the warmup challenge? The description states 25000, but with my code I get the error "too many cycles: 19102"?

Posted: Wed Dec 03, 2008 7:11 am
by adum
ah whoops, please try again

Posted: Wed Dec 03, 2008 4:31 pm
by Skeeve
Thank you, looks much better now (now it aborts after 25000 cycles - time to start optimizing the program ;-)

Posted: Thu Dec 04, 2008 11:05 am
by tog
The simple return "... is incorrect" is kind of frustrating. After some tuning, my program needs 19002 cycles to fill the Warmup-map. The solution is also correct (as I could verify with the Warmup-challenge). But still the non-Warmup Flash Flood says that my solution is simply incorrect. Is this due to some different (harder) board? And how many cycles did my program need for that board?

Posted: Thu Dec 04, 2008 2:49 pm
by tog
I further reduced my program to 18403 cycles on the Warm-Up board. The non-Warmup-Version still says that its incorrect. How small has it really got to be?