csrabak has joined #picolisp
csrabak has left #picolisp [#picolisp]
aw- has joined #picolisp
mtsd has joined #picolisp
aw- has quit [Quit: Leaving.]
<
Regenaxer>
tankf33der, can you post a link once more explaining optim bugs?
<
Regenaxer>
I'm asking in #llvm
<
Regenaxer>
about undefined behavior
<
Regenaxer>
Someone recommends 'llvm-reduce'. Do you know that?
<
Regenaxer>
Seems to "testcases when running a test suite"
<
Regenaxer>
Whatever that means
orivej has quit [Ping timeout: 240 seconds]
<
Regenaxer>
Oh! Embarrassing! I think it was my fault.
<
Regenaxer>
By closer inspection I found a bug in 'stem'
<
Regenaxer>
The stack may be corrupted
<
Regenaxer>
So it is reasonable that the optimizer changes the stack layout, resulting in correct or incorrect aehavior depending on the situation
<
Regenaxer>
tankf33der, sorry! Please test again!
<
Regenaxer>
So stupid that I did not see that!
<
tankf33der>
released ?
<
Regenaxer>
Standard unit tests passed here
<
tankf33der>
llvm12 and 13 failed in new place.
<
tankf33der>
7,11 ok
<
Regenaxer>
Which function fails?
<
tankf33der>
struct-OK
<
tankf33der>
[ht.l:10] "+123&abc&$def&-123&_+1_xyz_+7" -- 'test' failed
<
tankf33der>
((ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7)))
<
tankf33der>
if call ht.l alone it is ok
<
tankf33der>
if run in bundle failed, never seen before
<
Regenaxer>
Does it depend on optimizer?
<
tankf33der>
-O1 and -O3 the same
<
tankf33der>
it was always ok before today's fix
<
tankf33der>
and llvm 7,11 passed!
<
Regenaxer>
strange
<
tankf33der>
checking
<
tankf33der>
download file
<
tankf33der>
and run:
<
tankf33der>
pil t1.l
<
tankf33der>
[t1.l:1] "+123&abc&$def&-123&_+1_xyz_+7" -- 'test' failed
<
tankf33der>
((ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7)))
<
tankf33der>
pil j4.l
<
tankf33der>
so you cant repeat, right?
<
Regenaxer>
yes, works on 11
<
tankf33der>
running rest except ht
<
Regenaxer>
It uses begString and endString
<
Regenaxer>
perhaps something wrong here?
<
Regenaxer>
I check
<
Regenaxer>
(link (ofs (set $StrP P) 2)) looks wrong
<
Regenaxer>
Should be 3 (?)
<
Regenaxer>
correct
<
tankf33der>
# pil @lib/test.l +
<
tankf33der>
((ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7)))
<
tankf33der>
[/root/pil21/test/src/ht.l:9] "+123&abc&$def&-123&_+1_xyz_+7" -- 'test' failed
<
tankf33der>
so this is part of standard tests
orivej has joined #picolisp
<
tankf33der>
llvm12 with -O1 and O3 passed all tests without ht.l
<
tankf33der>
cant continue
<
Regenaxer>
Thanks!!
<
Regenaxer>
I will think hard what might be the cause
orivej has quit [Ping timeout: 265 seconds]
aw- has joined #picolisp
<
tankf33der>
Failed test itself
<
tankf33der>
because ht:Prin returns correct result
<
Regenaxer>
What does ht:Fmt return?
<
tankf33der>
what test expect
<
Regenaxer>
But test complains?
<
tankf33der>
it cant compare again
<
tankf33der>
so test-match-equal again
<
Regenaxer>
strange
<
Regenaxer>
It fails also if (test "+123&abc&$def&-123&_+1_xyz_+7" is running stand-alone?
<
Regenaxer>
just repl?
<
tankf33der>
Yes, always iirc
<
Regenaxer>
interesting
<
Regenaxer>
So it must be 'match'?
<
tankf33der>
It cant compare from shared object
<
tankf33der>
ht.so and so on
<
Regenaxer>
Return values from functions in *.so ?
<
Regenaxer>
then match fails?
<
Regenaxer>
Does this also fail? (test "+123" (ht:Fmt 123))
<
tankf33der>
Cant test
<
Regenaxer>
ok, good
<
Regenaxer>
If it fails, try '=' instead of 'match'
<
Regenaxer>
see you!
<
aw->
Regenaxer: hi
<
aw->
i have an issue loading @lib/simul.l
<
aw->
it seems some symbols dont get loaded
<
Regenaxer>
This library is in its own namespace now
<
aw->
it breaks some programs
<
Regenaxer>
yeah :)
<
Regenaxer>
Need to be changed
<
Regenaxer>
either (simul~grid ..) or run in the namespace
<
aw->
yeah i'll just change to the namespace
<
Regenaxer>
tankf33der also uses it a lot
<
Regenaxer>
iirc he used the ns spec
<
aw->
i can just (symbols 'simul 'pico) (my-code)..
<
Regenaxer>
If you just use a few functions, the spec is the easiest and safest
<
Regenaxer>
The chess program on the other hand does lib.l:(symbols 'chess 'simul 'pico)
<
Regenaxer>
Note that if you do (symbols 'simul 'pico)
<
Regenaxer>
then all new symbols go to 'simul'
<
Regenaxer>
This may be not desired
<
Regenaxer>
namespace modifyer
<
Regenaxer>
(simul~grid ...)
aw- has quit [Quit: Leaving.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
<
tankf33der>
Slowly playing with ht:Prin
<
tankf33der>
will report asap
<
Regenaxer>
Great. But I thought the problem is in ht:Fmt ?
<
tankf33der>
Around ht:Prin :)
<
Regenaxer>
In any case I'm very happy that we found the 'stem' bug
<
Regenaxer>
was a well hidden one
<
Regenaxer>
As I understand it, this fails: (test "+123&abc&$def&-123&_+1_xyz_+7" (ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7)))
<
Regenaxer>
So what would be interesting te see is what this returns: (ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7))
<
Regenaxer>
If it
*looks* correct, perhaps: (mapcar char (chop (ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7))))
<
Regenaxer>
to see the exact digits
<
tankf33der>
: (test "+123" (ht:Fmt 123))
<
tankf33der>
-> NIL
<
tankf33der>
this one is correct
<
tankf33der>
continue
<
tankf33der>
Regenaxer:
<
tankf33der>
i found minimal code which fails here
<
Regenaxer>
flow-OK
<
tankf33der>
on llvm12 if i comment first exec code than no failed test on ht:Fmt
<
Regenaxer>
Some state is changed
<
Regenaxer>
The question is
*what* fails
<
Regenaxer>
can't you trace match etc.?
<
Regenaxer>
or show what is returned by ht:Fmt
<
Regenaxer>
(see above)
<
Regenaxer>
I must know exactly where it fails
<
tankf33der>
[root@fedora ~]# pil +
<
tankf33der>
: (ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7))
<
tankf33der>
: (mapcar char (chop (ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7))))
<
tankf33der>
-> (43 49 50 51 38 97 98 99 38 36 100 101 102 38 45 49 50 51 38 95 43 49 95 120 121 122 95 43 55)
<
tankf33der>
-> "+123&abc&$def&-123&_+1_xyz_+7"
<
Regenaxer>
I check
<
tankf33der>
you should check again today's patch
<
Regenaxer>
ht:Fmt returns the correct value
<
Regenaxer>
So 'match' fails?
<
Regenaxer>
(trace 'match)
<
Regenaxer>
else 'bind' or 'fish'?
<
Regenaxer>
What do you mean with "check today's patch"?
<
tankf33der>
# pil +
<
tankf33der>
match = T
<
tankf33der>
: (load "flow-ht.l")
<
tankf33der>
: (trace 'match)
<
tankf33der>
-> match
<
tankf33der>
match : (123 abc) (123 abc)
<
tankf33der>
match : "+123&abc&$def&-123&_+1_xyz_+7" "+123&$abc&$def&-123&_+1_xyz_+7"
<
tankf33der>
match = NIL
<
tankf33der>
((ht:Fmt 123 "abc" 'def '{123} (1 "xyz" 7)))
<
tankf33der>
[flow-ht.l:8] "+123&abc&$def&-123&_+1_xyz_+7" -- 'test' failed
<
tankf33der>
What do you mean with "check today's patch"? - you step in stack and did something wrong.
<
Regenaxer>
yes, I checked all other sources for such a case
<
Regenaxer>
was all OK
<
Regenaxer>
The two strings are not the same
<
Regenaxer>
(= "+123&abc&$def&-123&_+1_xyz_+7" "+123&$abc&$def&-123&_+1_xyz_+7")
<
Regenaxer>
But where?
<
Regenaxer>
the "$"
<
Regenaxer>
it is wrongly inserted
<
Regenaxer>
"abc" is transient
<
Regenaxer>
but "$abc" is internal
<
Regenaxer>
ht:Fmt believes it got an internal symbol 'abc'
<
Regenaxer>
So something with namespace lookup
<
Regenaxer>
you have 'abc' before the other test
<
Regenaxer>
so 'abc' exists
<
Regenaxer>
but "abc" should be different
<
tankf33der>
but this was ok on your side
<
Regenaxer>
yes, llvm 11
<
Regenaxer>
must have to do with >= 12
<
Regenaxer>
Can you see if it the reader or if it is ht:Fmtf
<
Regenaxer>
eg. in the repl
<
Regenaxer>
first exec (test (123 abc) ...
<
Regenaxer>
and then
<
Regenaxer>
(123 "abc")
<
Regenaxer>
if it gives
<
Regenaxer>
-> (123 abc)
<
Regenaxer>
then the reader is faulty
<
Regenaxer>
otherwise ht:Fmt
<
tankf33der>
[root@fedora ~]# pil +
<
tankf33der>
: (test
<
tankf33der>
(pipe (exec 'echo 123 "abc")
<
tankf33der>
(list (read) (read)) ) )
<
tankf33der>
(123 abc)
<
tankf33der>
-> NIL
<
tankf33der>
: (123 abc)
<
tankf33der>
-> (123 abc)
<
Regenaxer>
: (123 "abc")
<
Regenaxer>
give a transient to the reader
<
tankf33der>
[root@fedora ~]# pil +
<
tankf33der>
(123 abc)
<
tankf33der>
: (test
<
tankf33der>
(pipe (exec 'echo 123 "abc")
<
tankf33der>
(list (read) (read)) ) )
<
tankf33der>
-> NIL
<
tankf33der>
: (123 "abc")
<
tankf33der>
-> (123 "abc")
<
Regenaxer>
and (ht:Fmt "abc")
<
Regenaxer>
does it give "$abc" again?
<
tankf33der>
[root@fedora ~]# pil +
<
tankf33der>
: (test
<
tankf33der>
(pipe (exec 'echo 123 "abc")
<
tankf33der>
(list (read) (read)) ) )
<
tankf33der>
(123 abc)
<
tankf33der>
-> NIL
<
tankf33der>
: (123 "abc")
<
tankf33der>
-> (123 "abc")
<
tankf33der>
: (ht:Fmt "abc")
<
tankf33der>
-> "$abc"
<
Regenaxer>
So ht:Fmt is wrong
<
Regenaxer>
'str' does the same as ht:Fmt (kind of)
<
Regenaxer>
what about:
<
Regenaxer>
: (str (123 "abc"))
<
Regenaxer>
-> "123 \"abc\""
<
Regenaxer>
does it return "123 abc" instead (wrongly)?
<
tankf33der>
: (test
<
tankf33der>
(list (read) (read)) ) )
<
tankf33der>
(123 abc)
<
tankf33der>
(pipe (exec 'echo 123 "abc")
<
tankf33der>
[root@fedora ~]# pil +
<
tankf33der>
-> NIL
<
tankf33der>
: (123 "abc")
<
tankf33der>
: (ht:Fmt "abc")
<
tankf33der>
-> (123 "abc")
<
tankf33der>
-> "$abc"
<
tankf33der>
: (str (123 "abc"))
<
tankf33der>
-> "123 \"abc\""
<
Regenaxer>
I see, this is correct
<
Regenaxer>
then it must be 'htFmt' (line 92 ff)
<
Regenaxer>
((findSym X Nm (val $Intern)) # Internal symbol
<
Regenaxer>
(call $Put (char "$")) # Prefix with "$"
<
Regenaxer>
no, this is correct
<
Regenaxer>
there
*is* an internal symbol 'abc'
<
Regenaxer>
Strange it works here!
<
Regenaxer>
It should never work then
<
Regenaxer>
I'm confused now :)
<
tankf33der>
opt without any -O argument works on llvm12
<
Regenaxer>
Interesting!
<
tankf33der>
as llvm-as too
<
Regenaxer>
'findSym' fails
<
Regenaxer>
gives false-positive
<
Regenaxer>
line 110 in src/ht.l
<
Regenaxer>
(str? "abc") also gives NIL?
<
Regenaxer>
(when 'abc' exists)
<
Regenaxer>
here on 11:
<
Regenaxer>
: (str? "abc")
<
Regenaxer>
-> "abc"
<
Regenaxer>
'str?' basically is 'findSym'
<
tankf33der>
[root@fedora ~]# pil +
<
tankf33der>
(123 abc)
<
tankf33der>
: (test
<
tankf33der>
(pipe (exec 'echo 123 "abc")
<
tankf33der>
(list (read) (read)) ) )
<
tankf33der>
-> NIL
<
tankf33der>
: (123 "abc")
<
tankf33der>
-> (123 "abc")
<
tankf33der>
: (ht:Fmt "abc")
<
tankf33der>
-> "$abc"
<
tankf33der>
: (str (123 "abc"))
<
tankf33der>
-> "123 \"abc\""
<
tankf33der>
: (str? "abc")
<
tankf33der>
i cant continue
<
tankf33der>
must run away
<
Regenaxer>
I inspect the code around ht:Fmt and findSym
<
Regenaxer>
Must be some other bug
<
Regenaxer>
Thanks!!
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
mtsd has quit [Ping timeout: 260 seconds]