Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some compiled ABCT behaves incorrectly when compared to CT output #6

Closed
hornc opened this issue Jul 24, 2022 · 4 comments
Closed

Some compiled ABCT behaves incorrectly when compared to CT output #6

hornc opened this issue Jul 24, 2022 · 4 comments

Comments

@hornc
Copy link
Owner

hornc commented Jul 24, 2022

A)

./ct.py <(./CTBASIC.py examples/ANIMTEST001.bas) 1

vs.

B)

../abct/abct-cli $(./CTBASIC.py examples/ANIMTEST001.bas -tABCT) 2 | cut -f5 | grep -v '^$'

Expect:
Both should produce identical output: endlessly repeating output
with 2 occurrences of

Tektronix 4010 animation in bitwise cyclic tag.

every iteration.

Actual:
Only A works as expected. B gives one-and-a-half iterations, then halts.

Either:

  1. The ABCT compilation is incorrect and differs from the CT version
    or
  2. There is a bug in the ABCT interpreter which only triggers when the datastring is relatively large.

Test 1 by confirming CT:

10000001001010101000101100101010110101101011101000101110010010110111101011011100101101001010111100001001000000100110100010011000001001100010100110000010010000001011000010101101110010110100101011011010101100001010111010001011010010101101111010110111001001000000101101001010110111001001000000101100010010110100101011101000101110111010110100101011100110101100101010010000001011000110101111001010110001101011011000101101001010110001101001000000101110100010110000101011001110100101110010000001101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1000000100100011101010010100101011000100100110000010100000001001011110101101010010011000001010000000100011111010000001101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10000001001000110110100001100010000001101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10000001001010101000101100101010110101101011101000101110010010110111101011011100101101001010111100001001000000100110100010011000001001100010100110000010010000001011000010101101110010110100101011011010101100001010111010001011010010101101111010110111001001000000101101001010110111001001000000101100010010110100101011101000101110111010110100101011100110101100101010010000001011000110101111001010110001101011011000101101001010110001101001000000101110100010110000101011001110100101110010000001101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1000000100100011101010010110001011001100100101100010101001001001011000101100110010011001101010011100100011111010000001101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10000001001000110110100001100010000001101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

converts to ABCT:

2725982173686371546601146872886478949676848343266687991455439775039246418566991564641072288886220641561220670417516878231337933182184221424474093486845123125288670924515227783347655713180738218612886808832567033405941261870209198197499335522520203793089647883525078726559522656322780833408305628209269451473841003952210357194804200927150864610020756488192140187415701229030023952457438960925517992085597157234115289733115229439541089867784618086421793464268100833257701933775660453143156550120230674427663139648925188894161008175666402137753021069691834098297645921724202153242602931770834033441974631172949352571451809476181649397847949984029722320500590490703749618295737914214793876366690181800306882307438513493238780477058778118173082607282107530831688589902108332787303323549563264682736128778696218029374094176060567774168320432597567000188014389411028017637004562908145413670119998291596935662982757593568414959308475684205073026516105003125317845476108577246127248204080999031261611309305491371624651666947921800000150020852464221004167616123654694382655473799426045366673852202654542189718580937791357707916724009533567448290513254034560106021425092655860067769504879958

For conversion comparison the compiled BCT is

111010101010101110101110111011101110101011101111101011101110111011111011101111101110111111101110101011101111111010111010111011111011111111101110111110111111101011101111101110101110111011111111101010101110101110101010101011101011111011101010111010111110101010101110101111101010111011101011111010101010111010111010101010101110111110101010111011101111101111111010111011111011101011101110111110111110111011101111101010101110111011111110111010101110111110111010111011101111101111111110111011111011111110101110101110101010101011101111101110101110111011111011111110101110101110101010101011101111101010111010111011111011101011101110111111101110101011101111111011111110111011111011101011101110111111101011111011101111101011101110111010111010101010101110111110101011111011101111111110101110111011111010101111101110111110111110101011101111101110101110111011111010101111101110101110101010101011101111111011101010111011111010101011101110111110101111111011101011101111111010111010101010101111101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111110111011101011101110101110111011111010101110101110101111101010101011101110101010101010111010111011111111101110111110111011101011101011111010101010111011101010101010101110101011111111111011101010101010111110110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111011111011101010101111101010111010101010101111101100000000000000000000000000000000000000000111010101010101110101110111011101110101011101111101011101110111011111011101111101110111111101110101011101111111010111010111011111011111111101110111110111111101011101111101110101110111011111111101010101110101110101010101011101011111011101010111010111110101010101110101111101010111011101011111010101010111010111010101010101110111110101010111011101111101111111010111011111011101011101110111110111110111011101111101010101110111011111110111010101110111110111010111011101111101111111110111011111011111110101110101110101010101011101111101110101110111011111011111110101110101110101010101011101111101010111010111011111011101011101110111111101110101011101111111011111110111011111011101011101110111111101011111011101111101011101110111010111010101010101110111110101011111011101111111110101110111011111010101111101110111110111110101011101111101110101110111011111010101111101110101110101010101011101111111011101010111011111010101011101110111110101111111011101011101111111010111010101010101111101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111110111011101011101111101010111011111010111110101110101110111110101011101110111010111010111010111011111010101110111110101111101011101011111010111110111011101011111110101110101011111111111011101010101010111110110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111011111011101010101111101010111010101010101111101100000000000000000000000000000000000000000
@hornc
Copy link
Owner Author

hornc commented Jul 24, 2022

Using the ABCT web interface BCT -> ABCT redirect endpoint, the compiled BCT converts to the same ABCT

curl -v  "abctag.herokuapp.com/b/111010101010101110101110111011101110101011101111101011101110111011111011101111101110111111101110101011101111111010111010111011111011111111101110111110111111101011101111101110101110111011111111101010101110101110101010101011101011111011101010111010111110101010101110101111101010111011101011111010101010111010111010101010101110111110101010111011101111101111111010111011111011101011101110111110111110111011101111101010101110111011111110111010101110111110111010111011101111101111111110111011111011111110101110101110101010101011101111101110101110111011111011111110101110101110101010101011101111101010111010111011111011101011101110111111101110101011101111111011111110111011111011101011101110111111101011111011101111101011101110111010111010101010101110111110101011111011101111111110101110111011111010101111101110111110111110101011101111101110101110111011111010101111101110101110101010101011101111111011101010111011111010101011101110111110101111111011101011101111111010111010101010101111101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111110111011101011101110101110111011111010101110101110101111101010101011101110101010101010111010111011111111101110111110111011101011101011111010101010111011101010101010101110101011111111111011101010101010111110110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111011111011101010101111101010111010101010101111101100000000000000000000000000000000000000000111010101010101110101110111011101110101011101111101011101110111011111011101111101110111111101110101011101111111010111010111011111011111111101110111110111111101011101111101110101110111011111111101010101110101110101010101011101011111011101010111010111110101010101110101111101010111011101011111010101010111010111010101010101110111110101010111011101111101111111010111011111011101011101110111110111110111011101111101010101110111011111110111010101110111110111010111011101111101111111110111011111011111110101110101110101010101011101111101110101110111011111011111110101110101110101010101011101111101010111010111011111011101011101110111111101110101011101111111011111110111011111011101011101110111111101011111011101111101011101110111010111010101010101110111110101011111011101111111110101110111011111010101111101110111110111110101011101111101110101110111011111010101111101110101110101010101011101111111011101010111011111010101011101110111110101111111011101011101111111010111010101010101111101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111110111011101011101111101010111011111010111110101110101110111110101011101110111010111010111010111011111010101110111110101111101011101011111010111110111011101011111110101110101011111111111011101010101010111110110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111010101010101110101110101011111011111011101010101111101010111010101010101111101100000000000000000000000000000000000000000/1"

result:

> Host: abctag.herokuapp.com
> User-Agent: curl/7.58.0
> Accept: */*
> 
< HTTP/1.1 303 See Other
< Connection: close
< Server: SimpleHTTP/0.6 Python/3.6.11
< Date: Mon, 25 Jul 2022 05:03:28 GMT
< Location: /2725982173686371546601146872886478949676848343266687991455439775039246418566991564641072288886220641561220670417516878231337933182184221424474093486845123125288670924515227783347655713180738218612886808832567033405941261870209198197499335522520203793089647883525078726559522656322780833408305628209269451473841003952210357194804200927150864610020756488192140187415701229030023952457438960925517992085597157234115289733115229439541089867784618086421793464268100833257701933775660453143156550120230674427663139648925188894161008175666402137753021069691834098297645921724202153242602931770834033441974631172949352571451809476181649397847949984029722320500590490703749618295737914214793876366690181800306882307438513493238780477058778118173082607282107530831688589902108332787303323549563264682736128778696218029374094176060567774168320432597567000188014389411028017637004562908145413670119998291596935662982757593568414959308475684205073026516105003125317845476108577246127248204080999031261611309305491371624651666947921800000150020852464221004167616123654694382655473799426045366673852202654542189718580937791357707916724009533567448290513254034560106021425092655860067769504879958/1/
< Content-Type: application/json;charset=utf-8
< Via: 1.1 vegur
< 
* Closing connection 0
{}

So that suggests at least the BCT to ABCT conversion is accurate across two interpreters, and the ABCT interpreter is receiving the correct code to start with.

@hornc
Copy link
Owner Author

hornc commented Jul 24, 2022

Using diff to locate where the datastrings diverge:

n=3150; diff <(./ct.py -d <(./CTBASIC.py examples/ANIMTEST001.bas) 1 | head -n${n}) <(../abct/abct-cli $(./CTBASIC.py examples/ANIMTEST001.bas -tABCT) 2 | cut -f3  | tail -n+2 | head -n${n})

(uses a slightly modified version of ct.py which does not send output to STDOUT in debug mode to make the comparison cleaner)

diff result:

3147,3150c3147,3150
< 1101000101110010010110111101011011100101101001010111100001001000000100110100010011000001001100010100110000010010000001011000010101101110010110100101011011010101100001010111010001011010010101101111010110111001001000000101101001010110111001001000000101100010010110100101011101000101110111010110100101011100110101100101010010000001011000110101111001010110001101011011000101101001010110001101001000000101110100010110000101011001110100101110010000001101
< 101000101110010010110111101011011100101101001010111100001001000000100110100010011000001001100010100110000010010000001011000010101101110010110100101011011010101100001010111010001011010010101101111010110111001001000000101101001010110111001001000000101100010010110100101011101000101110111010110100101011100110101100101010010000001011000110101111001010110001101011011000101101001010110001101001000000101110100010110000101011001110100101110010000001101
< 01000101110010010110111101011011100101101001010111100001001000000100110100010011000001001100010100110000010010000001011000010101101110010110100101011011010101100001010111010001011010010101101111010110111001001000000101101001010110111001001000000101100010010110100101011101000101110111010110100101011100110101100101010010000001011000110101111001010110001101011011000101101001010110001101001000000101110100010110000101011001110100101110010000001101
< 1000101110010010110111101011011100101101001010111100001001000000100110100010011000001001100010100110000010010000001011000010101101110010110100101011011010101100001010111010001011010010101101111010110111001001000000101101001010110111001001000000101100010010110100101011101000101110111010110100101011100110101100101010010000001011000110101111001010110001101011011000101101001010110001101001000000101110100010110000101011001110100101110010000001101
---
> 111010001011100100101101111010110111001011010010101111000010010000001001101000100110000010011000101001100000100100000010110000101011011100101101001010110110101011000010101110100010110100101011011110101101110010010000001011010010101101110010010000001011000100101101001010111010001011101110101101001010111001101011001010100100000010110001101011110010101100011010110110001011010010101100011010010000001011101000101100001010110011101001011100100000011010
> 11010001011100100101101111010110111001011010010101111000010010000001001101000100110000010011000101001100000100100000010110000101011011100101101001010110110101011000010101110100010110100101011011110101101110010010000001011010010101101110010010000001011000100101101001010111010001011101110101101001010111001101011001010100100000010110001101011110010101100011010110110001011010010101100011010010000001011101000101100001010110011101001011100100000011010
> 1010001011100100101101111010110111001011010010101111000010010000001001101000100110000010011000101001100000100100000010110000101011011100101101001010110110101011000010101110100010110100101011011110101101110010010000001011010010101101110010010000001011000100101101001010111010001011101110101101001010111001101011001010100100000010110001101011110010101100011010110110001011010010101100011010010000001011101000101100001010110011101001011100100000011010
> 010001011100100101101111010110111001011010010101111000010010000001001101000100110000010011000101001100000100100000010110000101011011100101101001010110110101011000010101110100010110100101011011110101101110010010000001011010010101101110010010000001011000100101101001010111010001011101110101101001010111001101011001010100100000010110001101011110010101100011010110110001011010010101100011010010000001011101000101100001010110011101001011100100000011010

@hornc
Copy link
Owner Author

hornc commented Jul 30, 2022

Fixed by hornc/abctag#8

@hornc
Copy link
Owner Author

hornc commented Jul 30, 2022

../abct/abct-cli $(./CTBASIC.py examples/ANIMTEST001.bas -tABCT) 2 | cut -f5 | grep -v '^$'

now produces the correct endlessly looping output as expected using the latest abct code, v1.2.0 Not a bug in this example or interpreter. Closing as fixed!

@hornc hornc closed this as completed Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant