endo icon indicating copy to clipboard operation
endo copied to clipboard

daemon: `followLocatorNameChanges()` implementation is incomplete

Open rekmarks opened this issue 1 year ago • 0 comments

  1. Remove initialization of H to -1; instead, use calloc for initalizatio nto 0 and index the samples by 1, ..., n+1; also make sure to update the sampler to check if the sample is <= n, and return one minus

https://github.com/probcomp/fast-loaded-dice-roller/blob/2fb32e94a04c744c86aa4cb54b3ee0259894e777/src/c/fldr.c#L55 https://github.com/probcomp/fast-loaded-dice-roller/blob/2fb32e94a04c744c86aa4cb54b3ee0259894e777/src/c/fldr.c#L97-L98

  1. Remove unneeded additions https://github.com/probcomp/fast-loaded-dice-roller/blob/2fb32e94a04c744c86aa4cb54b3ee0259894e777/src/c/fldr.c#L57 https://github.com/probcomp/fast-loaded-dice-roller/blob/2fb32e94a04c744c86aa4cb54b3ee0259894e777/src/c/fldr.c#L65

  2. Change bool to int https://github.com/probcomp/fast-loaded-dice-roller/blob/2fb32e94a04c744c86aa4cb54b3ee0259894e777/src/c/fldr.c#L56 https://github.com/probcomp/fast-loaded-dice-roller/blob/2fb32e94a04c744c86aa4cb54b3ee0259894e777/src/c/fldr.c#L64

The main bottleneck in preprocessing is bit extraction from the a[i]. It might more efficient to compute the probability matrix in reverse order (i.e., with the least significant bit in the first column) and using integer division on the running values of a[i], instead of bit shifts/masking.

rekmarks avatar Apr 17 '24 00:04 rekmarks