From 20a304fc365191fc94d2cc469f6c890fe3526bfe Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 17:56:36 +0000 Subject: [PATCH] Trust cached null entry augmentation in range path (!== undefined) The range-augmentation path used ?? , so a legitimately-cached null augmentation was treated as a miss and re-extracted. Match make()'s !== undefined check so null-augmentation entries hit the cache. Co-Authored-By: Konstantin Wohlwend --- .../piledriver/data-structures/augmented-tree-map.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/bulldozer-js/src/databases/piledriver/data-structures/augmented-tree-map.ts b/apps/bulldozer-js/src/databases/piledriver/data-structures/augmented-tree-map.ts index ddaef6fd2..d51ee23b1 100644 --- a/apps/bulldozer-js/src/databases/piledriver/data-structures/augmented-tree-map.ts +++ b/apps/bulldozer-js/src/databases/piledriver/data-structures/augmented-tree-map.ts @@ -637,8 +637,12 @@ export class AugmentedTreeMultiMap= 1 ? node.entryAugmentations?.[i] : undefined) - ?? await this.options.extractAugmentation(await this.loadValue(node.entries[i][1]), node.entries[i][0].key, node.entries[i][0].id); + // Trust the cached augmentation only for versioned nodes, and check `!== undefined` (not + // `??`) so a legitimately-cached `null` augmentation is still a hit rather than re-extracted. + const cachedEntryAug = (node.version ?? 0) >= 1 ? node.entryAugmentations?.[i] : undefined; + const entryAug = cachedEntryAug !== undefined + ? cachedEntryAug + : await this.options.extractAugmentation(await this.loadValue(node.entries[i][1]), node.entries[i][0].key, node.entries[i][0].id); result = await this.merge(result, entryAug); } }