Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.rrb-vector by

Was playing with advent of code and puzzle 19 second part.

I have a program that mostly does catvec + subvec at https://github.com/mattiasw2/adventofcode1/blob/master/src/adventofcode1/nineteen_b.clj

The smallest sample that fails with

ArrayIndexOutOfBoundsException 33 clojure.core.rrb-vector.rrbt.Vector/fn--19277 (rrbt.clj:373)


(puzzle-b 978)

(I was using (stest/check `puzzle-b) )

I reimplemented the program using plain vectors, and everything works fine (except that I haven't been able to run the big sample)


which works fine.

6 Answers

0 votes
_Comment made by: michalmarczyk_

Hi, thanks for the report! I think I'm in the process of fixing this – at least it looks like a manifestation of an issue I'm working on and should hopefully go away once that fix lands. I'll look into it, anyway.
0 votes

Comment made by: leif

I'm also getting this error, particularly on larger vectors (e.g. size > 1000) after many subvec/catvec operations that often insert elements into the middle of a vector.

This unfortunately makes this libary unusable for me at the moment, but would love to switch back if this problem is fixed :)

0 votes
_Comment made by: mattiasw_

I got collection-check up and running (missing .core in require), see https://github.com/mattiasw2/core.rrb-vector/commit/abef418cf6ceb7c293c54c224089b397990740bc

and now collection-check fails

lein test :only clojure.core.rrb-vector-check/collection-check

FAIL in (collection-check) (rrb_vector_check.clj:8)
expected: (assert-vector-like 250 (fv/vector) gen/int)
  actual: (not (assert-vector-like 250 [] #clojure.test.check.generators.Generator{:gen #object[clojure.test.check.generators$sized$fn__1400 0x354e7004 "clojure.test.check.generators$sized$fn__1400@354e7004"]}))

lein test clojure.core.rrb-vector-test

Ran 12 tests containing 54 assertions.
1 failures, 0 errors.
Tests failed.
0 votes

Comment made by: mattiasw

I have asked at https://github.com/ztellman/collection-check/issues/17 on how to get more information why not vector-like

0 votes

Comment made by: jafingerhut

Michal, you mention that you may have been in the process of fixing this. I don't see any commits that look relevant since that message was written. Do you perhaps have any partial fixes/improvements towards this that someone else might start from? There is always starting from the existing code, of course, but was curious if you might have some clues or pointers from your investigation.

0 votes
Reference: https://clojure.atlassian.net/browse/CRRBV-14 (reported by alex+import)