Skip to content

Commit

Permalink
Fixed invalid testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Böhm committed Jan 24, 2025
1 parent 3b05111 commit 41efb25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
5 changes: 1 addition & 4 deletions js/src/encodings/fastpfor/bitpacking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3030,10 +3030,7 @@ export function fastunpack(inArray: Uint32Array, inpos: number, outArray: Uint32
}

function fastunpack0(inArray: Uint32Array, inpos: number, outArray: Uint32Array, outpos: number) {
for (let i = 0; i < 32; i++) {
outArray[outpos + i] = 0;
}
// outArray.fill(0, outpos, outpos + 32);
outArray.fill(0, outpos, outpos + 32);
}

function fastunpack1(inArray: Uint32Array, inpos: number, outArray: Uint32Array, outpos: number) {
Expand Down
13 changes: 5 additions & 8 deletions js/src/encodings/fastpfor/fastpfor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,13 @@ export class FastPFOR implements IntegerCODEC, SkippableIntegerCODEC {
public headlessUncompress(model: { input: Uint32Array, inpos: number, output: Uint32Array, outpos: number, num: number }) : void {
const mynvalue = greatestMultiple(model.num, FastPFOR.BLOCK_SIZE);
const finalout = model.outpos.valueOf() + mynvalue;
const inner_model = { input: model.input, inpos: model.inpos, output: model.output, outpos: model.outpos, thissize: 0 };
while (inner_model.outpos.valueOf() != finalout) {
inner_model.thissize = Math.min(this.pageSize, finalout - inner_model.outpos.valueOf());
this.decodePage(inner_model);
while (model.outpos.valueOf() != finalout) {
model.num = Math.min(this.pageSize, finalout - model.outpos.valueOf());
this.decodePage(model);
}
model.output = inner_model.output;
model.outpos = inner_model.outpos;
}

public decodePage(model: { input: Uint32Array, inpos: number, output: Uint32Array, outpos: number, thissize: number }) {
public decodePage(model: { input: Uint32Array, inpos: number, output: Uint32Array, outpos: number, num: number }) {
const initpos = model.inpos.valueOf();
const wheremeta = model.input[model.inpos];
model.inpos += 1;
Expand Down Expand Up @@ -102,7 +99,7 @@ export class FastPFOR implements IntegerCODEC, SkippableIntegerCODEC {
let tmpinpos = model.inpos.valueOf();
this.byteContainer.flip();

for (let run = 0, run_end = model.thissize / FastPFOR.BLOCK_SIZE; run < run_end; ++run, tmpoutpos += FastPFOR.BLOCK_SIZE) {
for (let run = 0, run_end = model.num / FastPFOR.BLOCK_SIZE; run < run_end; ++run, tmpoutpos += FastPFOR.BLOCK_SIZE) {
const b = this.byteContainer.readByte();
const cexcept = this.byteContainer.readByte() & 0xFF;
for (let k = 0; k < FastPFOR.BLOCK_SIZE; k += 32) {
Expand Down
Binary file modified js/test/data/250k_ascending_fastpfor.bin
Binary file not shown.

0 comments on commit 41efb25

Please sign in to comment.