Re: belated feedback Bradley Lucier 30 Apr 2021 14:16 UTC


On 4/30/21 1:40 AM, Alex Shinn wrote:
> On Sat, Apr 17, 2021 at 10:22 AM Alex Shinn <xxxxxx@gmail.com> wrote:
 >
> FYI I've implemented the indexer optimization/flattening in Chibi head.
> I use the same approach for reshaping and just verify agreement on
> offsets when taking one step in every dimension from the old and new
> domains.  I'm pretty sure this works (it passes all the tests) but haven't
> proved it.

Interesting.

> Note the resulting indexers are more optimized than in the SRFI 179
> reference implementation.  Your indexers are subtracting out the lower
> bounds from the indexes on each call (optimizing out the first few 0 lower
> bound cases), but you can just subtract that out from the base offset in
> advance, whether or not the value is 0.

When I wrote that I wanted to avoid bignum intermediate computations
when all the lower and upper bounds and the final index are fixnums.
Around the same time Marc Feeley had refactored the Gambit runtime to
allow building Gambit with only fixnums and flonums in the numeric
"tower", so perhaps that influenced my thinking.

Brad