My submission fails although tests are passing when run them manually

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

My submission fails although tests are passing when run them manually

Asya
My asm-files pass all the tests (Mult.tst, FillAutomatic.tst) when I run them manually in CPU-emulator, but for some reasons they fail when I submit them in zip-archieve. The errors are:

*(-50) - Test failed (code = diff_with_test_Mult) - Mult: Comparison failure at line 2
*(-50) - Test failed (code = diff_with_test_Fill) - Fill: At line 32767: Can't continue past last line

I'm almost sure that from my side all is good. Can anybody take a look, maybe smth is wrong from the grader's side?  
Reply | Threaded
Open this post in threaded view
|

Re: My submission fails although tests are passing when run them manually

WBahn
Administrator
Take a look at what? You haven't given us anything to work with other than the two error messages.

About the only observation I can make on such limited information is that your Fill program is reaching the end of ROM space, which means that your program is running away into non-program memory somehow.
Reply | Threaded
Open this post in threaded view
|

Re: My submission fails although tests are passing when run them manually

Asya
Oh, sorry, of course.. Let's start with Mult.asm. Here is the contents:

  @i
  M=1 //i = 1
  @mult
  M=0 //mult = 0

(LOOP)
  @i
  D=M
  @R1
  D=D-M //now D contains i-R1
  @STOP
  D;JGT //if i > R1 goto STOP

  @R0
  D=M
  @mult
  M=D+M //mult = mult + R0
  @i
  M=M+1 //i = i + 1
  @LOOP
  0;JMP

(STOP)
  @mult
  D=M
  @R2
  M=D //RAM[2] = mult

(END)
  @END
  0;JMP

I understand that it's not efficient, but now we talk about correctness.
I thought that the grader on your side simply runs provided tests, but probably it's smth else.
Reply | Threaded
Open this post in threaded view
|

Re: My submission fails although tests are passing when run them manually

Bobber
Not sure if test cases use negative numbers, but this won't work if R0 is negative, it'll just go straight to end. Looping one time at the most
Reply | Threaded
Open this post in threaded view
|

Re: My submission fails although tests are passing when run them manually

Asya
It has constraints that R0 and R1 >= 0. But I've already found the problem, it somehow used R2 in grader. After I've set it to 0, problem disappeared. :)