soegaard / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
145 stars 14 forks source link

test suite test-assemble.rkt failing #34

Closed stchang closed 9 years ago

stchang commented 9 years ago
Running (E-many (list (make-PushEnvironment 2 #f)) "M.e.length") ...
#(struct:exn:fail:contract:arity assemble/write-invoke: arity mismatch;
 the expected number of arguments does not match the given number
  expected: 3
  given: 2
  arguments...:
   (list (PushEnvironment 2 #f))
   #<output-port:string> #<continuation-mark-set>)
. test: Runtime error: got #(struct:error-happened "assemble/write-invoke: arity mismatch;\n the expected number of arguments does not match the given number\n  expected: 3\n  given: 2\n  arguments...:\n   (list (PushEnvironment 2 #f))\n   #<output-port:string>" #<continuation-mark-set> 1) in: (test (E-many (list (make-PushEnvironment 2 #f)) "M.e.length") "2")
stchang commented 9 years ago

Does anyone have additional information about the test suites? Specifically, have they been abandoned? How long have they been broken? They seem like they may be significantly out of sync with the compiler.

Just trying to get a feel for how much effort it would take to fix them.

schanzer commented 9 years ago

The only code I've touched since @dyoo 's last commit is in the image library, so any broken tests there are my fault (though I believe I updated those tests when I pushed my changes, so they should be passing).

@soegaard, any ideas?

soegaard commented 9 years ago

I think the test suite has been broken for a very long time. I don't know for how long.

/Jens Axel

2015-06-09 20:57 GMT+02:00 Emmanuel Schanzer notifications@github.com:

The only code I've touched since @dyoo https://github.com/dyoo 's last commit is in the image library, so any broken tests there are my fault (though I believe I updated those tests when I pushed my changes, so they should be passing).

@soegaard https://github.com/soegaard, any ideas?

— Reply to this email directly or view it on GitHub https://github.com/soegaard/whalesong/issues/34#issuecomment-110464423.

Jens Axel Søgaard

schanzer commented 9 years ago

Was it broken when you initially forked from @dyoo 's repo?

soegaard commented 9 years ago

I think so - but I am only 90% sure.

/Jens Axel

2015-06-09 23:54 GMT+02:00 Emmanuel Schanzer notifications@github.com:

Was it broken when you initially forked from @dyoo https://github.com/dyoo 's repo?

— Reply to this email directly or view it on GitHub https://github.com/soegaard/whalesong/issues/34#issuecomment-110515542.

Jens Axel Søgaard

stchang commented 9 years ago

What I've seen supports what @soegaard is saying. For example this test suite in question test-assemble.rkt still calls assemble/write-invoke (from js-assemble/assemble.rkt) with 2 arguments. The current version of assemble/write-invoke requires a third argument trampoline-option which seems fundamental to whalesong's current design, suggesting that the tests have not been updated in a while.

stchang commented 9 years ago

One of our current goals is to try to get all the tests running, so we have a more stable foundation with which to experiment with more substantial improvements to whalesong, but I'm trying to get a feel for how long that might take.

schanzer commented 9 years ago

Fully agree that getting the tests running is a priority. @dyoo , can you weigh in on this at all?

dyoo commented 9 years ago

Apologies; I don't remember much about the state of those tests.

vishesh commented 9 years ago

I've figured out what's causing the problem here. Success handler is added to end of call-stack[1]. However, by end of trampoline, the success handler is not getting called and machine has this call frame left in stack. This is therefore a bug with whalesong, tests are fine (unlike test-browser-evaluate). If manually do this callback by end of trampoline[2], tests passes.

I'm not sure if its right way to do that and looking into it. But seems like yes, as earlier we had explicit error handler which did exactly that https://github.com/soegaard/whalesong/commit/0428a021bd2e94953c3b3086d2c5fa1cbd5dbb81

[1] https://github.com/soegaard/whalesong/blob/master/whalesong/js-assembler/assemble.rkt#L82 [2] https://github.com/soegaard/whalesong/blob/master/whalesong/js-assembler/runtime-src/runtime.js#L753

stchang commented 9 years ago

Interesting. So if commit 0428a02 is reverted, the tests all (except browser-evaluate) pass? Do our test pastes still compile and run?

vishesh commented 9 years ago

Yes. I'm just about to send pull request for it.