Search
Friday, 20th of September 2019, 9:15:14 UTC
13:30:20
pfdietz
I am seeing a heap corruption error in some varieties of random testing on the SEARCH function. Trying to track it down, but reproducibility is difficult.
16:39:43
stassats
feels unlikely that SEARCH itself is broken
17:42:44
stassats
right, a type conflict
17:51:06
stassats
so, search can return an index beyond the sequence...
17:54:16
stassats
judging by the comments, i did envision that, but " only when searching for "" and :start2 being equal to :end2"
17:55:54
stassats
i really need to invent some NIL type derivation catcher
17:56:29
stassats
so that it doesn't just go off the rails
18:06:32
stassats
ok, that's easy, now, why doesn't (position a (the (simple-vector 8) b)) derive that it's below 8
18:11:44
stassats
it loses the type after getting transformed to SB-KERNEL:%FIND-POSITION
18:18:12
stassats
suppose i can make it stick around, still it may be too early
18:18:33
stassats
but i'm not that eager to define a type deriver on %find-position
18:18:58
stassats
this is where attaching type derivation to lvars would have come in handy
18:20:32
stassats
i should try making a proof of concept, before drowning in duplicate transforms/type derivers
18:22:18
pkhuong
might also be useful to have another kind of note to drive the post-IR1 pattern matching
18:22:39
pkhuong
and more easily replace useless inlining with the original call
18:25:53
stassats
will start with type derivation, as i don't have to think about removing dead code
18:26:43
stassats
and improving position is a good case
18:29:51
eschatologist_
** NICK eschatologist
20:52:23
jasom
(disassemble (lambda (x) (declare (optimize (speed 3)) (type (unsigned-byte 16) x)) (sb-rotate-byte:rotate-byte 1 (byte 16 0) x)))
20:52:40
jasom
is it expected that there is a call to SB-ROTATE-BYTE::%ROTATE-BYTE in this case?
20:53:31
jasom
so don't use rotate-byte for non-machine-word sizes?
20:56:38
stassats
although x86-64 can add vops
20:58:05
stassats
jasom: what's your use-case?
21:00:12
jasom
stassats: rolling 16-bit hash
21:00:41
jasom
an open-coded ldb/ash is pretty fast, so I'll use that.
21:02:17
stassats
i'd say sb-rotate-byte:rotate-byte should implement 16/8-bit rotates where possible and perform inline rotations for arbitrary widths
21:06:20
jasom
I was expecting at least an inlined-rotation
21:08:18
stassats
dusting off hacker's delight
Friday, 20th of September 2019, 21:15:14 UTC