Search
Sunday, 17th of March 2019, 10:37:20 UTC
14:14:06
Krystof
pfdietz: that's very weird
14:14:28
Krystof
karlosz: how much of your port is working now?
16:23:28
pfdietz
It's not reading backquote from a file. From the REPL, backquote works fine.
16:37:20
pfdietz
The other problem: (posix-getenv "SBCL_HOME") returns NIL. Is that expected under Windows?
16:39:40
stassats
it is expected if you don't set it
16:52:46
pfdietz
May have been a problem with :env in slime?
17:49:08
karlosz
Krystof: it gets all the way to braid in pcl, and then gives some weird error like "24 is not of type INDEX", but im able to get a repl and everything else seems to be working fine
17:49:55
stassats
karlosz: what happens when you do (car 'a) at the repl?
17:50:03
stassats
or rather (aref #() 'a)
17:50:14
karlosz
the value A is not of type list in the lisp debugger
17:50:43
stassats
24 is not of type INDEX is in the lisp debugger?
17:50:49
karlosz
and also invalid index A for (simple vector 0), should be a non negative integer below 0
17:50:59
karlosz
24 is not of type INDEX in the lisp debugger
17:51:06
karlosz
seems a bit like a miscompilation thing
17:51:17
karlosz
since it doesnt quite match what the xc produces
17:51:25
stassats
ok, neither car nor aref are checking for INDEX
17:51:47
karlosz
i mean, index checking works otherwise
17:52:05
stassats
and gets reported correctly?
17:52:39
stassats
anyway, (setf (fill-pointer #()) 'a) check for INDEX
17:53:00
karlosz
the disassembly works a bit better now, so eres the disassemblly for the offending function. it makes it kinda of obvious that the code just falls through into the index error https://paste.gnome.org/ptmkwpxox
17:53:39
karlosz
(setf (fill-pointer #()) 'a) says the value A is not of type sb-int:index in the lisp debugger, as expecterd
17:53:44
stassats
oh, it's still the make-cache thing
17:55:04
karlosz
yeah, so it computes compute cache mask and falls straight into the error
17:55:19
stassats
can you edit make-cache to just do the second leg of the IF?
17:56:26
karlosz
yeah, otherwise infinite recursion
17:56:53
stassats
builds ok on x86-64, straight calling to %make-cache
18:00:07
karlosz
alright, launched make target 2, expect something in 20 mins...
18:02:53
stassats
the next time it fails you can try redefining it at the repl
18:11:32
karlosz
oh, thats right. ive done that before and it works fine
18:12:03
stassats
redefining or removing the IF?
18:14:14
karlosz
just redefining in the repl
18:36:30
karlosz
okay, the plot thickens. clearly make cache is just not being compiled correctly https://paste.gnome.org/pkj9hwdtw
18:36:46
karlosz
but this should be easier to investigate, since the error makes a bit of sense now
18:37:35
stassats
does it? looks like another drop through problem
18:37:53
karlosz
yeah, the disassembly says it is
18:38:40
karlosz
also, in the disassembly listing i gave, the very end of the call also drops through. is tthat okay because its a missing arg error?
18:38:48
stassats
don't quit the debugger yet
18:39:19
stassats
turn the let into (line-size 2) (adjusted-size 32)
18:39:31
stassats
and call with (MAKE-CACHE :KEY-COUNT 1 :VALUE T :SIZE 24)
18:51:23
stassats
i don't see %make-cache
18:54:28
karlosz
arent structure things inlined?
18:54:41
stassats
and there's no sqrt either
18:56:02
karlosz
yeah, thats pretty weird, considering i know sqrt is supposed to properly translate to an instruction
18:56:41
stassats
well, it goes off the rails after calling SB-PCL::COMPUTE-CACHE-MASK
18:57:44
stassats
can you replace compute-cache-mask with (logand (1- vector-length) (- line-size)) then
18:59:28
karlosz
yeah, i accidentally screwed up and continued the debugger instead of retrying...
19:00:34
karlosz
interrupts dont seem to work very well yet
19:00:44
karlosz
which is another problem i need to investiage
19:01:17
karlosz
too bad the only riscv board that can run linux is 1k
19:42:23
karlosz
so make-cache with line size and adjusted size fixed works
19:44:30
stassats
does it fail somewhere else?
19:44:42
karlosz
oh, i just meant calling make cache worked
19:44:56
karlosz
im assuming thats because compute-mask just got constant folded
19:45:09
stassats
compute-cache-mask is not inlined
19:45:31
karlosz
but when i changed it back and replaced compute-mask with (logand (1- length) (- line-size)) i got 64 is not of type (or (mod ...) cons null)
19:45:36
stassats
so, change line-size only
19:46:53
karlosz
with just line-size changed i get -2 is not of type (or ...)
19:47:15
stassats
replace (compute-limit adjusted-size) with 2
19:47:26
karlosz
keeping line size at 2?
19:48:52
stassats
so, (ceiling (sqrt (sqrt size))) is up to no good
19:49:47
stassats
try (ceiling (sqrt adjusted-size))?
19:54:32
stassats
and then, rollback all the changes and change compute-limit to (locally (declare (notinline sqrt)) (ceiling (sqrt (sqrt adjusted-size))))
19:55:45
karlosz
when i change :limit ot (ceiling (sqrt adjusted-size)), i get a function withj declared result type nil returned compute cache mask
19:56:06
karlosz
oh, this might be related to the conditionalization in irrayt
19:58:14
karlosz
A function with declared result type NIL returned:
19:58:29
stassats
that's falling through too
19:58:47
karlosz
okay, will try rolling back
20:00:08
karlosz
A function with declared result type NIL returned:
20:00:14
karlosz
with the locally delcartion
20:03:42
karlosz
https://paste.gnome.org/pwnjfqwk0
20:04:37
stassats
what's (sb-int:info :function :type 'sqrt)
20:05:15
karlosz
https://paste.gnome.org/pr2bg51db
20:05:49
stassats
ok, so it's the deriver
20:06:44
karlosz
oh, but that should be backend independent?
20:07:49
karlosz
well i remember conditionalizing sqrt in irrat.lisp because riscv has a float instruction for it, if that has anything to do with this
20:08:16
stassats
what's (sb-kernel:%simple-fun-type (lambda (x) (declare ((integer 1 4611686018427387904) x) (notinline sqrt)) (sqrt x)))
20:09:28
karlosz
(FUNCTION ((INTEGER 1 4611686018427387904)) NIL)
20:11:24
karlosz
doh, it was just a reader conditional on constant folding missing
20:12:06
stassats
was it? there isn't any constants here, really
20:12:18
stassats
and a missing constant fold function would produce a warning
20:12:36
karlosz
but then why would the type deriver be wrong
20:12:44
stassats
what does (sqrt 4611686018427387904) return
20:13:37
stassats
what about (sb-kernel:%sqrt (float 4611686018427387904 1d0))
20:14:06
stassats
and (sb-kernel:%sqrt (float 4 1d0)) ?
20:15:05
karlosz
okay, trying to bisect this to the first 0.0d0
20:15:09
stassats
what's (float 4611686018427387904 1d0) ?
20:15:43
karlosz
i have to fix some float vops it seems
20:15:53
karlosz
thanks for your help, i know what im looking for now
20:15:59
stassats
that'd be (sb-kernel:%double-float 4611686018427387904)
20:19:44
stassats
does (sb-kernel:%double-float (expt 2 30)) work?
20:24:31
stassats
i think your fcvt is missing a bit in RS2 for 64-bit integers
21:30:04
karlosz
double floating gives 1.073741824d9
21:30:34
karlosz
but double-floating the >32 bit number gives 0
21:30:44
stassats
yeah, the RS2 bit would cause that
21:31:51
karlosz
what do you mean by the "RS2 bit"?
21:32:14
stassats
fcvtw-> #b11010 :rs2 #b00000 should be fcvtw-> #b11010 :rs2 #b00010
21:34:01
karlosz
but why? the isa spec has no bits set
21:34:08
karlosz
are we reading the same table?
21:35:25
stassats
https://i.imgur.com/Kibmefj.png
21:38:06
karlosz
oh nice catch. yeah im missed those instruction entirely... need l and w, what a pain
21:38:41
stassats
who needs 32-bit conversion on a 64-bit target
21:39:16
karlosz
yeah, thats what ive been doing to keep the backend portable
21:39:31
karlosz
i kept stuff like addiw since those might help with modular arithmatic
Sunday, 17th of March 2019, 22:37:20 UTC