@gmod/tabix 3.6.0 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { SharedReadCache } from '@gmod/shared-read-cache';
2
2
  import type Chunk from './chunk.ts';
3
3
  import type { Options } from './indexFile.ts';
4
4
  import type { ChunkSlice } from '@gmod/bgzf-filehandle';
5
+ import type { SharedBudget } from '@gmod/shared-read-cache';
5
6
  import type { GenericFilehandle } from 'generic-filehandle2';
6
7
  type GetLinesCallback = (line: string, fileOffset: number, start: number, end: number) => void;
7
8
  interface GetLinesOpts {
@@ -24,15 +25,12 @@ export default class TabixIndexedFile {
24
25
  private filehandle;
25
26
  private index;
26
27
  chunkCache: SharedReadCache<Chunk, ReadChunk>;
27
- private headerP?;
28
28
  /**
29
- * The signal `headerP` was started under, while it is still in flight. The
30
- * header is parsed once and shared by every caller, so without this the first
31
- * one to arrive would own a read all the others depend on — see
32
- * {@link getParsedHeader}.
29
+ * The parsed header, as a shared read — see {@link getParsedHeader}. One
30
+ * entry, never evicted, which is what a memo is.
33
31
  */
34
- private headerSignal?;
35
- constructor({ path, filehandle, url, tbiPath, tbiUrl, tbiFilehandle, csiPath, csiUrl, csiFilehandle, chunkCacheSize, chunkCacheIdleTimeoutMs, }: {
32
+ private headerCache;
33
+ constructor({ path, filehandle, url, tbiPath, tbiUrl, tbiFilehandle, csiPath, csiUrl, csiFilehandle, chunkCacheSize, chunkCacheIdleTimeoutMs, chunkCacheBudget, }: {
36
34
  path?: string;
37
35
  filehandle?: GenericFilehandle;
38
36
  url?: string;
@@ -45,6 +43,17 @@ export default class TabixIndexedFile {
45
43
  /**
46
44
  * Budget for the decompressed chunk cache, in bytes. Default 1GB.
47
45
  *
46
+ * **The unit changed in v3.5.2** (ADR 0001). Before that this was divided
47
+ * by 64KB to get an entry count, so a caller passing `50 * 2**20` was
48
+ * asking for 800 whole decompressed chunks — unbounded in practice. It now
49
+ * means 50MB, twenty times under the default, and the name did not change
50
+ * so nothing warns. jbrowse still passes exactly that in nine adapters:
51
+ * measured on `test/data/1kg.chr1.subset.vcf.gz` it is a **total miss**,
52
+ * 47 refills out of 47 on the warm pass against 0 at the default, holding
53
+ * 82.7MB in a single entry — over the budget it was given, because the last
54
+ * settled entry is kept whatever the budget. If you pinned a value here
55
+ * before v3.5.2, it does not mean what it did.
56
+ *
48
57
  * A retention bound, not a bound on peak memory: reads in flight are never
49
58
  * evicted and the last settled entry is kept whatever the budget. Size it
50
59
  * to hold several queries — below one query's working set the hit rate
@@ -60,6 +69,24 @@ export default class TabixIndexedFile {
60
69
  * makes the budget above a peak rather than a resting level.
61
70
  */
62
71
  chunkCacheIdleTimeoutMs?: number;
72
+ /**
73
+ * A budget shared with other files — any `@gmod/shared-read-cache`
74
+ * consumer, so `@gmod/bam` and `@gmod/cram` can join the same one — so
75
+ * that the ceiling applies to their sum rather than to each of them.
76
+ *
77
+ * {@link chunkCacheSize} is per file, which is not a bound on a consumer
78
+ * that opens one file per track. @gmod/bam measured the shape: six tracks
79
+ * browsing six windows retained 1442 MB with every cache still under its
80
+ * own ceiling, so the ceiling was not holding the line and nothing else
81
+ * was. The idle timeout cannot help there — it does nothing while the
82
+ * reader is browsing, which is the whole case.
83
+ *
84
+ * Dividing {@link chunkCacheSize} by the track count instead reintroduces
85
+ * the cliff it exists to avoid. A shared budget does not, because a member
86
+ * yields only what is globally least-recently-used: files nobody is
87
+ * reading hand their space to the one being panned.
88
+ */
89
+ chunkCacheBudget?: SharedBudget;
63
90
  });
64
91
  /**
65
92
  * Drops every decompressed chunk held by the cache, and stops the idle sweep
@@ -134,16 +161,21 @@ export default class TabixIndexedFile {
134
161
  * charge of a read every later caller joins: when it aborted, they failed
135
162
  * with its cancellation, their own signals untouched.
136
163
  *
137
- * A caller that joined someone else's parse and saw it fail because *they*
138
- * aborted starts over rather than inheriting the failure — once, then
139
- * propagates. Same bounded retry, and the same reasoning, as
140
- * `IndexFile.parse`.
164
+ * The same cache the chunk reads use, and the same rule: the parse runs under
165
+ * a signal of its own and is cancelled only once every caller waiting on it
166
+ * has given up, so one caller's abort is reported to that caller alone and a
167
+ * bystander gets the parse already in flight. There is no retry here because
168
+ * there is nothing to retry — the parse a bystander joined is not cancelled by
169
+ * someone else's abort. A rejection is dropped rather than cached, so a
170
+ * transient failure does not poison the header for the life of the file.
171
+ *
172
+ * The fill is per call rather than on the cache, so the caller that starts the
173
+ * parse has its `onProgress` reach the index download inside `getMetadata`.
141
174
  *
142
175
  * SYNC: ~/src/gmod/bam-js/src/bamFile.ts getHeader — same shape for the same
143
176
  * reason, on the header rather than the index.
144
177
  */
145
178
  private getParsedHeader;
146
- private startHeaderParse;
147
179
  /**
148
180
  * The bytes of the commented header. Deliberately not memoized, unlike the
149
181
  * string form: this hands back the buffer, and holding one for the lifetime
@@ -193,15 +193,12 @@ class TabixIndexedFile {
193
193
  filehandle;
194
194
  index;
195
195
  chunkCache;
196
- headerP;
197
196
  /**
198
- * The signal `headerP` was started under, while it is still in flight. The
199
- * header is parsed once and shared by every caller, so without this the first
200
- * one to arrive would own a read all the others depend on — see
201
- * {@link getParsedHeader}.
197
+ * The parsed header, as a shared read — see {@link getParsedHeader}. One
198
+ * entry, never evicted, which is what a memo is.
202
199
  */
203
- headerSignal;
204
- constructor({ path, filehandle, url, tbiPath, tbiUrl, tbiFilehandle, csiPath, csiUrl, csiFilehandle, chunkCacheSize = DEFAULT_CHUNK_CACHE_BYTES, chunkCacheIdleTimeoutMs = DEFAULT_CHUNK_CACHE_IDLE_TIMEOUT_MS, }) {
200
+ headerCache = new shared_read_cache_1.SharedReadCache({});
201
+ constructor({ path, filehandle, url, tbiPath, tbiUrl, tbiFilehandle, csiPath, csiUrl, csiFilehandle, chunkCacheSize = DEFAULT_CHUNK_CACHE_BYTES, chunkCacheIdleTimeoutMs = DEFAULT_CHUNK_CACHE_IDLE_TIMEOUT_MS, chunkCacheBudget, }) {
205
202
  this.filehandle = resolveFilehandle(filehandle, path, url);
206
203
  this.index = resolveIndex({
207
204
  tbiFilehandle,
@@ -220,6 +217,7 @@ class TabixIndexedFile {
220
217
  sizeOf: read => read.buffer.byteLength,
221
218
  cacheKey: chunk => chunk.toString(),
222
219
  idleTimeoutMs: chunkCacheIdleTimeoutMs,
220
+ budget: chunkCacheBudget,
223
221
  fill: (chunk, signal) => this.readChunk(chunk, { signal }),
224
222
  });
225
223
  }
@@ -454,51 +452,22 @@ class TabixIndexedFile {
454
452
  * charge of a read every later caller joins: when it aborted, they failed
455
453
  * with its cancellation, their own signals untouched.
456
454
  *
457
- * A caller that joined someone else's parse and saw it fail because *they*
458
- * aborted starts over rather than inheriting the failure — once, then
459
- * propagates. Same bounded retry, and the same reasoning, as
460
- * `IndexFile.parse`.
455
+ * The same cache the chunk reads use, and the same rule: the parse runs under
456
+ * a signal of its own and is cancelled only once every caller waiting on it
457
+ * has given up, so one caller's abort is reported to that caller alone and a
458
+ * bystander gets the parse already in flight. There is no retry here because
459
+ * there is nothing to retry — the parse a bystander joined is not cancelled by
460
+ * someone else's abort. A rejection is dropped rather than cached, so a
461
+ * transient failure does not poison the header for the life of the file.
462
+ *
463
+ * The fill is per call rather than on the cache, so the caller that starts the
464
+ * parse has its `onProgress` reach the index download inside `getMetadata`.
461
465
  *
462
466
  * SYNC: ~/src/gmod/bam-js/src/bamFile.ts getHeader — same shape for the same
463
467
  * reason, on the header rather than the index.
464
468
  */
465
- async getParsedHeader(opts = {}, retried = false) {
466
- (0, util_ts_1.throwIfAborted)(opts.signal);
467
- const pending = this.headerP;
468
- if (!pending) {
469
- return this.startHeaderParse(opts);
470
- }
471
- // read before awaiting: the owner is forgotten as soon as the parse settles
472
- const ownerSignal = this.headerSignal;
473
- try {
474
- return await pending;
475
- }
476
- catch (e) {
477
- if (retried || !ownerSignal?.aborted || opts.signal?.aborted) {
478
- throw e;
479
- }
480
- return this.getParsedHeader(opts, true);
481
- }
482
- }
483
- startHeaderParse(opts) {
484
- const pending = this.parseHeader(opts);
485
- this.headerP = pending;
486
- this.headerSignal = opts.signal;
487
- // Drop a rejection rather than keeping it, so one transient failure does not
488
- // poison the header for the lifetime of the file. Both branches are
489
- // identity-checked so a retry started after this settles is not cleared by
490
- // the attempt it already replaced.
491
- pending.then(() => {
492
- if (this.headerP === pending) {
493
- this.headerSignal = undefined;
494
- }
495
- }, () => {
496
- if (this.headerP === pending) {
497
- this.headerP = undefined;
498
- this.headerSignal = undefined;
499
- }
500
- });
501
- return pending;
469
+ getParsedHeader(opts = {}) {
470
+ return this.headerCache.get('header', opts.signal, signal => this.parseHeader({ ...opts, signal }));
502
471
  }
503
472
  /**
504
473
  * The bytes of the commented header. Deliberately not memoized, unlike the
@@ -1 +1 @@
1
- {"version":3,"file":"tabixIndexedFile.js","sourceRoot":"","sources":["../src/tabixIndexedFile.ts"],"names":[],"mappings":";;;;;AAAA,2DAA8D;AAC9D,+DAAyD;AACzD,6DAA2D;AAE3D,sDAA0B;AAC1B,sDAA0B;AAC1B,uCAA0D;AAQ1D,MAAM,GAAG,GAAG,CAAC,CAAA;AACb,MAAM,OAAO,GAAG,EAAE,CAAA;AAClB,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,SAAS,GAAG,EAAE,CAAA;AAEpB,+EAA+E;AAC/E,+EAA+E;AAC/E,kEAAkE;AAClE,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAE/B,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,4EAA4E;AAC5E,2EAA2E;AAC3E,kDAAkD;AAClD,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,+EAA+E;AAC/E,sEAAsE;AACtE,qEAAqE;AACrE,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAA;AAEhD,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AA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,cAAc,CAAC,OAAgB,EAAE;QACrC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;QACjE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACxE,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,OAAgB,EAAE;QAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QAC7C,OAAO,QAAQ,CAAC,WAAW,CAAA;IAC7B,CAAC;IAED,6CAA6C;IAC7C,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,OAAgB,EAAE;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,SAAS,CAAC,CAAQ,EAAE,OAAgB,EAAE;QAC1C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACpC,CAAC,CAAC,WAAW,EAAE,EACf,CAAC,CAAC,IAAI,CAAC,aAAa,EACpB,IAAI,CACL,CAAA;QACD,OAAO,IAAA,iCAAe,EAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAChC,CAAC;CACF;AA/eD,mCA+eC"}
@@ -49,14 +49,11 @@ export interface IndexData {
49
49
  }
50
50
  export default abstract class IndexFile {
51
51
  filehandle: GenericFilehandle;
52
- private parseP?;
53
52
  /**
54
- * The signal `parseP` was started under, while it is still in flight. The
55
- * index is parsed once and shared by every query against the file, so without
56
- * this the first query to arrive would own a read all the others depend on —
57
- * see {@link parse}.
53
+ * The parsed index, as a shared read — see {@link parse}. One entry, never
54
+ * evicted, which is what a memo is.
58
55
  */
59
- private parseSignal?;
56
+ private parseCache;
60
57
  constructor({ filehandle }: {
61
58
  filehandle: GenericFilehandle;
62
59
  });
@@ -124,28 +121,27 @@ export default abstract class IndexFile {
124
121
  * The index is downloaded and parsed once for the life of this object, so it
125
122
  * is the one read here that is shared between queries — and therefore the one
126
123
  * place a cancellation can leak from the query that asked for it to a query
127
- * that did not. `_parse` hands `opts` straight to `readIndexBytes`, so
128
- * without this the first query to arrive owns a read every other query
129
- * depends on: when it pans away, every concurrent query fails with its abort.
124
+ * that did not. `_parse` hands `opts` straight to `readIndexBytes`, so a bare
125
+ * memoized promise makes the first query to arrive the owner of a read every
126
+ * other query depends on: when it pans away, every concurrent query fails
127
+ * with its abort.
130
128
  *
131
- * A caller that joined someone else's parse and saw it fail because *they*
132
- * aborted starts over rather than inheriting the failure — once, then
133
- * propagates. Bounding it at one attempt is what jbrowse's
134
- * `RemoteFileWithRangeCache.joinChunk` does with the same retry one layer
135
- * down, and for the reason it gives: the pathological case becomes one
136
- * duplicate parse rather than a recursion whose depth depends on how the
137
- * aborts interleave.
129
+ * The same cache `ChunkCache` uses, for the same reason and with the same
130
+ * rule: the parse runs under a signal of its own and is cancelled only once
131
+ * every caller waiting on it has given up, so one query's abort is reported
132
+ * to that query alone and a bystander gets the parse already in flight rather
133
+ * than having to re-read the index. A rejection is dropped rather than
134
+ * cached, so a transient failure does not poison the index for the life of
135
+ * the file.
138
136
  *
139
- * A retry rather than the reference count `ChunkCache` uses, because the
140
- * index is parsed once for the life of the object: there is no repeated waste
141
- * to recover, and this is a dozen lines against restructuring the memo.
142
- * `@gmod/bam`'s `IndexFile` and `@gmod/cram`'s `CraiIndex` make the same
143
- * split for the same reason.
137
+ * The fill is per call rather than on the cache so that the caller who starts
138
+ * the parse has its `onProgress` reach `readIndexBytes` — the index is a
139
+ * whole-file read, and a determinate "downloading index" bar is what that
140
+ * callback exists for.
144
141
  *
145
142
  * @internal
146
143
  */
147
- parse(opts?: Options, retried?: boolean): Promise<IndexData>;
148
- private startParse;
144
+ parse(opts?: Options): Promise<IndexData>;
149
145
  /** @internal */
150
146
  hasRefSeq(seqId: number, opts?: Options): Promise<boolean>;
151
147
  }
package/esm/indexFile.js CHANGED
@@ -1,15 +1,13 @@
1
1
  import { unzip } from '@gmod/bgzf-filehandle';
2
- import { optimizeChunks, throwIfAborted } from "./util.js";
2
+ import { SharedReadCache } from '@gmod/shared-read-cache';
3
+ import { optimizeChunks } from "./util.js";
3
4
  export default class IndexFile {
4
5
  filehandle;
5
- parseP;
6
6
  /**
7
- * The signal `parseP` was started under, while it is still in flight. The
8
- * index is parsed once and shared by every query against the file, so without
9
- * this the first query to arrive would own a read all the others depend on —
10
- * see {@link parse}.
7
+ * The parsed index, as a shared read — see {@link parse}. One entry, never
8
+ * evicted, which is what a memo is.
11
9
  */
12
- parseSignal;
10
+ parseCache = new SharedReadCache({});
13
11
  constructor({ filehandle }) {
14
12
  this.filehandle = filehandle;
15
13
  }
@@ -73,71 +71,36 @@ export default class IndexFile {
73
71
  }
74
72
  return optimizeChunks(chunks, this.lowestOffset(ba, min, indexData));
75
73
  }
76
- // SYNC: ~/src/gmod/bam-js/src/indexFile.ts parse — same owner-signal
77
- // tracking and one-attempt retry, and the same reasoning below.
74
+ // SYNC: ~/src/gmod/bam-js/src/indexFile.ts parse — same shape and the same
75
+ // reasoning below.
78
76
  /**
79
77
  * Parse the index, or join the parse already running.
80
78
  *
81
79
  * The index is downloaded and parsed once for the life of this object, so it
82
80
  * is the one read here that is shared between queries — and therefore the one
83
81
  * place a cancellation can leak from the query that asked for it to a query
84
- * that did not. `_parse` hands `opts` straight to `readIndexBytes`, so
85
- * without this the first query to arrive owns a read every other query
86
- * depends on: when it pans away, every concurrent query fails with its abort.
82
+ * that did not. `_parse` hands `opts` straight to `readIndexBytes`, so a bare
83
+ * memoized promise makes the first query to arrive the owner of a read every
84
+ * other query depends on: when it pans away, every concurrent query fails
85
+ * with its abort.
87
86
  *
88
- * A caller that joined someone else's parse and saw it fail because *they*
89
- * aborted starts over rather than inheriting the failure — once, then
90
- * propagates. Bounding it at one attempt is what jbrowse's
91
- * `RemoteFileWithRangeCache.joinChunk` does with the same retry one layer
92
- * down, and for the reason it gives: the pathological case becomes one
93
- * duplicate parse rather than a recursion whose depth depends on how the
94
- * aborts interleave.
87
+ * The same cache `ChunkCache` uses, for the same reason and with the same
88
+ * rule: the parse runs under a signal of its own and is cancelled only once
89
+ * every caller waiting on it has given up, so one query's abort is reported
90
+ * to that query alone and a bystander gets the parse already in flight rather
91
+ * than having to re-read the index. A rejection is dropped rather than
92
+ * cached, so a transient failure does not poison the index for the life of
93
+ * the file.
95
94
  *
96
- * A retry rather than the reference count `ChunkCache` uses, because the
97
- * index is parsed once for the life of the object: there is no repeated waste
98
- * to recover, and this is a dozen lines against restructuring the memo.
99
- * `@gmod/bam`'s `IndexFile` and `@gmod/cram`'s `CraiIndex` make the same
100
- * split for the same reason.
95
+ * The fill is per call rather than on the cache so that the caller who starts
96
+ * the parse has its `onProgress` reach `readIndexBytes` — the index is a
97
+ * whole-file read, and a determinate "downloading index" bar is what that
98
+ * callback exists for.
101
99
  *
102
100
  * @internal
103
101
  */
104
- async parse(opts = {}, retried = false) {
105
- throwIfAborted(opts.signal);
106
- const pending = this.parseP;
107
- if (!pending) {
108
- return this.startParse(opts);
109
- }
110
- // read before awaiting: the owner is forgotten as soon as the parse settles
111
- const ownerSignal = this.parseSignal;
112
- try {
113
- return await pending;
114
- }
115
- catch (e) {
116
- if (retried || !ownerSignal?.aborted || opts.signal?.aborted) {
117
- throw e;
118
- }
119
- return this.parse(opts, true);
120
- }
121
- }
122
- startParse(opts) {
123
- const pending = this._parse(opts);
124
- this.parseP = pending;
125
- this.parseSignal = opts.signal;
126
- // Drop a rejection rather than keeping it, so one transient failure does not
127
- // poison the index for the lifetime of the file. Both branches are
128
- // identity-checked so a retry started after this settles is not cleared by
129
- // the attempt it already replaced.
130
- pending.then(() => {
131
- if (this.parseP === pending) {
132
- this.parseSignal = undefined;
133
- }
134
- }, () => {
135
- if (this.parseP === pending) {
136
- this.parseP = undefined;
137
- this.parseSignal = undefined;
138
- }
139
- });
140
- return pending;
102
+ parse(opts = {}) {
103
+ return this.parseCache.get('index', opts.signal, signal => this._parse({ ...opts, signal }));
141
104
  }
142
105
  /** @internal */
143
106
  async hasRefSeq(seqId, opts = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"indexFile.js","sourceRoot":"","sources":["../src/indexFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAiD1D,MAAM,CAAC,OAAO,OAAgB,SAAS;IAC9B,UAAU,CAAmB;IAC5B,MAAM,CAAqB;IACnC;;;;;OAKG;IACK,WAAW,CAAc;IAEjC,YAAY,EAAE,UAAU,EAAqC;QAC3D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAyBD;;;OAGG;IACO,KAAK,CAAC,cAAc,CAAC,IAAa;QAC1C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YACzC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAA;QACF,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;QAC9B,OAAO;YACL,KAAK;YACL,QAAQ,EAAE,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;SACzE,CAAA;IACH,CAAC;IAED,gBAAgB;IACT,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,OAAgB,EAAE;QACxD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACxC,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,KAAK,KA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} from '@gmod/shared-read-cache';
2
2
  import type Chunk from './chunk.ts';
3
3
  import type { Options } from './indexFile.ts';
4
4
  import type { ChunkSlice } from '@gmod/bgzf-filehandle';
5
+ import type { SharedBudget } from '@gmod/shared-read-cache';
5
6
  import type { GenericFilehandle } from 'generic-filehandle2';
6
7
  type GetLinesCallback = (line: string, fileOffset: number, start: number, end: number) => void;
7
8
  interface GetLinesOpts {
@@ -24,15 +25,12 @@ export default class TabixIndexedFile {
24
25
  private filehandle;
25
26
  private index;
26
27
  chunkCache: SharedReadCache<Chunk, ReadChunk>;
27
- private headerP?;
28
28
  /**
29
- * The signal `headerP` was started under, while it is still in flight. The
30
- * header is parsed once and shared by every caller, so without this the first
31
- * one to arrive would own a read all the others depend on — see
32
- * {@link getParsedHeader}.
29
+ * The parsed header, as a shared read — see {@link getParsedHeader}. One
30
+ * entry, never evicted, which is what a memo is.
33
31
  */
34
- private headerSignal?;
35
- constructor({ path, filehandle, url, tbiPath, tbiUrl, tbiFilehandle, csiPath, csiUrl, csiFilehandle, chunkCacheSize, chunkCacheIdleTimeoutMs, }: {
32
+ private headerCache;
33
+ constructor({ path, filehandle, url, tbiPath, tbiUrl, tbiFilehandle, csiPath, csiUrl, csiFilehandle, chunkCacheSize, chunkCacheIdleTimeoutMs, chunkCacheBudget, }: {
36
34
  path?: string;
37
35
  filehandle?: GenericFilehandle;
38
36
  url?: string;
@@ -45,6 +43,17 @@ export default class TabixIndexedFile {
45
43
  /**
46
44
  * Budget for the decompressed chunk cache, in bytes. Default 1GB.
47
45
  *
46
+ * **The unit changed in v3.5.2** (ADR 0001). Before that this was divided
47
+ * by 64KB to get an entry count, so a caller passing `50 * 2**20` was
48
+ * asking for 800 whole decompressed chunks — unbounded in practice. It now
49
+ * means 50MB, twenty times under the default, and the name did not change
50
+ * so nothing warns. jbrowse still passes exactly that in nine adapters:
51
+ * measured on `test/data/1kg.chr1.subset.vcf.gz` it is a **total miss**,
52
+ * 47 refills out of 47 on the warm pass against 0 at the default, holding
53
+ * 82.7MB in a single entry — over the budget it was given, because the last
54
+ * settled entry is kept whatever the budget. If you pinned a value here
55
+ * before v3.5.2, it does not mean what it did.
56
+ *
48
57
  * A retention bound, not a bound on peak memory: reads in flight are never
49
58
  * evicted and the last settled entry is kept whatever the budget. Size it
50
59
  * to hold several queries — below one query's working set the hit rate
@@ -60,6 +69,24 @@ export default class TabixIndexedFile {
60
69
  * makes the budget above a peak rather than a resting level.
61
70
  */
62
71
  chunkCacheIdleTimeoutMs?: number;
72
+ /**
73
+ * A budget shared with other files — any `@gmod/shared-read-cache`
74
+ * consumer, so `@gmod/bam` and `@gmod/cram` can join the same one — so
75
+ * that the ceiling applies to their sum rather than to each of them.
76
+ *
77
+ * {@link chunkCacheSize} is per file, which is not a bound on a consumer
78
+ * that opens one file per track. @gmod/bam measured the shape: six tracks
79
+ * browsing six windows retained 1442 MB with every cache still under its
80
+ * own ceiling, so the ceiling was not holding the line and nothing else
81
+ * was. The idle timeout cannot help there — it does nothing while the
82
+ * reader is browsing, which is the whole case.
83
+ *
84
+ * Dividing {@link chunkCacheSize} by the track count instead reintroduces
85
+ * the cliff it exists to avoid. A shared budget does not, because a member
86
+ * yields only what is globally least-recently-used: files nobody is
87
+ * reading hand their space to the one being panned.
88
+ */
89
+ chunkCacheBudget?: SharedBudget;
63
90
  });
64
91
  /**
65
92
  * Drops every decompressed chunk held by the cache, and stops the idle sweep
@@ -134,16 +161,21 @@ export default class TabixIndexedFile {
134
161
  * charge of a read every later caller joins: when it aborted, they failed
135
162
  * with its cancellation, their own signals untouched.
136
163
  *
137
- * A caller that joined someone else's parse and saw it fail because *they*
138
- * aborted starts over rather than inheriting the failure — once, then
139
- * propagates. Same bounded retry, and the same reasoning, as
140
- * `IndexFile.parse`.
164
+ * The same cache the chunk reads use, and the same rule: the parse runs under
165
+ * a signal of its own and is cancelled only once every caller waiting on it
166
+ * has given up, so one caller's abort is reported to that caller alone and a
167
+ * bystander gets the parse already in flight. There is no retry here because
168
+ * there is nothing to retry — the parse a bystander joined is not cancelled by
169
+ * someone else's abort. A rejection is dropped rather than cached, so a
170
+ * transient failure does not poison the header for the life of the file.
171
+ *
172
+ * The fill is per call rather than on the cache, so the caller that starts the
173
+ * parse has its `onProgress` reach the index download inside `getMetadata`.
141
174
  *
142
175
  * SYNC: ~/src/gmod/bam-js/src/bamFile.ts getHeader — same shape for the same
143
176
  * reason, on the header rather than the index.
144
177
  */
145
178
  private getParsedHeader;
146
- private startHeaderParse;
147
179
  /**
148
180
  * The bytes of the commented header. Deliberately not memoized, unlike the
149
181
  * string form: this hands back the buffer, and holding one for the lifetime