aiquadtreejs Changelog
[Unreleased]
Section titled “[Unreleased]”[0.5.5] - 2026-06-08
Section titled “[0.5.5] - 2026-06-08”Changed
Section titled “Changed”- Project home migrated to the
isluminaGitHub org; the package is now published from there via npm trusted publisher (OIDC + SLSA provenance). Family-wide version alignment at0.5.5— no runtime or API changes.
[0.5.2] - 2026-06-05
Section titled “[0.5.2] - 2026-06-05”- Review-driven documentation fixes (
README.md,README_ZHTW.md,llms-full.txt) and corrected a stale version reference in thesrc/index.tsheader comment. No functional change;distbyte-identical to 0.5.1.
[0.5.1] - 2026-06-02
Section titled “[0.5.1] - 2026-06-02”insert()input validation —insert()now throwsQuadtreeErrorwhen the inserted object contains a non-finite coordinate (NaN,Infinity,-Infinityin any ofx,y,width,height) or a negative dimension (width < 0orheight < 0). Previously, such objects were silently mishandled (kept before subdivide, silently dropped after). Zero-extent objects (points / lines withwidth=0and/orheight=0) remain valid and are not rejected. TheQuadtreeErrorJSDoc already noted this use was reserved; the behaviour is now implemented and documented inSTABILITY.md.
- Added J-group (J1–J15):
insert()throwsQuadtreeErrorforwidth<0,height<0,NaN/Infinityin any ofx/y/width/height, and fornull/undefinedobjects (J14/J15); valid zero-extent objects (width=0, height=0, mixed) are accepted. - Added K-group (K1–K7): oversized object appears exactly once in
full-region and per-quadrant sub-queries after subdivide;
retrieveIntobuffer identity preserved across 60 clear+insert+retrieveInto frames; negative-origin bounds with negative-coord objects and queries; zero- extent point at a non-midpoint survives deep subdivision (maxLevels=4) and is retrievable with a tight region; maxLevels=1 with many same- quadrant objects — all retrievable, zero duplicates; non-origin bounds insert+retrieve correctness.
[0.4.0] - 2026-05-29
Section titled “[0.4.0] - 2026-05-29”Dependency hygiene + stability freeze. No runtime API addition or behaviour
change — dist/index.js is byte-identical to 0.3.1; consumers see no
difference. This release unifies the ai*js family version line at 0.4.0 and
formally freezes the public surface for the 1.x track.
Changed
Section titled “Changed”- devDependencies — removed unused
tsx(no script, config, or example in this package invoked it) and alignedfast-check^3.23.0→^4.8.0to match the rest of the ai*js family. Both are dev-only and absent from the published tarball (filesshipsdist+ docs only), so consumers are unaffected.
Stability
Section titled “Stability”- The 0.3.x public surface —
createQuadtree, theQuadtree<T>interface and all its members (insert/retrieve/retrieveInto/clear/dispose/disposed),AABB,QuadtreeOptions,QuadtreeError,QuadtreeDisposedError— is declared frozen for the 1.x track: it will not break before a 1.0.0+ major. The 3D octree variant remains a draft (target v0.6+).
Internal (not shipped to npm)
Section titled “Internal (not shipped to npm)”pnpm auditreports no known vulnerabilities;pnpm-lock.yamlregenerated after the devDependency changes. Property tests re-run green under fast-check v4.
[0.3.1] - 2026-05-29
Section titled “[0.3.1] - 2026-05-29”Changed
Section titled “Changed”retrieveIntois now genuinely zero-allocation in steady state. The internal dedupSetand DFS stack are hoisted to the tree instance and reused across calls (cleared, not re-created) instead of being allocated per query. Combined with the caller-ownedtargetbuffer, a per-frame broadphase loop issuing thousands ofretrieveIntoqueries now allocates nothing once result sizes stabilise — the design goal stated in 0.3.0. Purely internal: no API, signature, or observable-behaviour change.retrievestill returns a fresh array each call.dispose()now also clears the internal scratch, preserving the “drops references so the GC can reclaim everything” guarantee.- Docs —
AABBJSDoc leads with a renderer-neutral right-open definition (PixiJSgetBounds()demoted to a compatibility note);dispose()JSDoc now listsretrieveIntoamong the post-dispose throwers; the 0.3.0 changelog note reworded (“observationally identical” rather than “byte-for-byte”);STABILITY.mdexports list now includes theQuadtree<T>interface.
Internal (not shipped to npm)
Section titled “Internal (not shipped to npm)”- Property test
prop2usesfc.uniqueArraykeyed onidinstead of an early-return guard that skipped ~39% of runs on id collisions; the id-uniqueness invariant now runs on every case. Property generators mix in zero-extent midpoint points (fc.oneof) so the dedup invariants exercise the G4 regression shape, not just deterministic fixtures. - Tightened
I4(toBe(1)); addedI13(retrieve fresh-array vs retrieveInto buffer-reuse contrast — backward-compat lock) andI14(interleaved retrieve / retrieveInto correctness — shared-scratch guard).
dist/index.jsruntime differs from 0.3.0 only by the scratch-hoist optimisation; the public API and all observable behaviour are unchanged.
[0.3.0] - 2026-05-29
Section titled “[0.3.0] - 2026-05-29”retrieveInto(region: AABB, target: T[]): T[]— zero-allocation variant ofretrievefor hot-path callers. Clearstarget, walks the same iterative DFS + Set dedup asretrieve, writes results intotarget, returnstarget. The returned reference equals the argument — callers can hold a permanent buffer and pass it every frame to eliminate the result-array allocation churn (5,000+ calls per frame in typical bullet-hell broadphase loops).STABILITY.md— explicit stable vs experimental API tracking. Includes a v0.6+ 3D octree draft (no source code in this release).- Property-based tests via
fast-check— 4 invariants coveringretrievededup andretrieveIntoidentity / length / content equivalence. Addsfast-checktodevDependencies.
Changed
Section titled “Changed”Quadtree.clearJSDoc — corrected the claim that “internal node objects are reused across frames”; only the root node is reused, child nodes are released onclear()and re-created when subdivision next triggers. No runtime behaviour change.- README Roadmap / Status / API sketch — synced to v0.3.0,
including the
retrieveInto(region, target)signature (the pre-0.2 Roadmap entry was a single-argument draft).
retrievebehaviour is observationally identical to 0.1.1: the internal refactor extracts a sharedretrieveSethelper that bothretrieveandretrieveIntocall, butSetinsertion order →Array.fromorder is preserved by spec.- Bundle size: ≤ 2 KB gzip budget still ~50% headroom after this release (expected ~1050-1090 B gzip).
[0.1.1] - 2026-05-28
Section titled “[0.1.1] - 2026-05-28”Changed (CI)
Section titled “Changed (CI)”publish.ymlnow triggers onpush: tags: ["v*"](wasworkflow_dispatchonly). Aligns with the trigger used byaifsmjs/aiecsjs/aibridgejs. Tag push now automatically runs the OIDC trusted publish.npm publish --provenance --access public— the workflow now emits a sigstore provenance attestation so consumers can verify the tarball was built by this workflow on this commit.
No runtime / source / API changes from 0.1.0. 0.1.1 is also the first version to actually land on npm — 0.1.0 was tagged in git but never published to npm. Production bundles are byte-identical to the 0.1.0 git tag.
[0.1.0] - 2026-05-28
Section titled “[0.1.0] - 2026-05-28”createQuadtree({ bounds, maxObjects, maxLevels })factory — 2D AABB broadphase.insert(obj)/retrieve(region)/clear()/dispose()lifecycle.- Set-based dedup on
retrieve()so objects spanning multiple quadrants are returned once. - Per-frame rebuild model —
clear()reuses internal node objects (zero GC churn frame-to-frame). disposedread-only flag; post-dispose calls throwQuadtreeDisposedError.- Test coverage ≥95% statements / lines / functions / ≥90% branches (~30 it() blocks, groups A–H).
- Size budget: ≤2 KB gzip.
- Dual ESM + CJS build via
tsupwithminify: true;sideEffects: false; zero runtime dependencies.
[0.0.1] - 2026-05-28
Section titled “[0.0.1] - 2026-05-28”Added (scaffold)
Section titled “Added (scaffold)”- Full package scaffold landed (
package.json,tsconfig.json,tsconfig.test.json,tsup.config.ts,vitest.config.ts,biome.json,scripts/{verify-exports,check-size,build-llms-full}.mjs,test/scaffold.test.ts,examples/.gitkeep,.github/workflows/{ci,publish}.yml,llms.txt,llms-full.txt). src/index.tsremains athrowstub exposing the frozen 0.1.0 API surface (createQuadtree,Quadtree<T>,QuadtreeOptions,AABB,QuadtreeError,QuadtreeDisposedError).pnpm typecheck && pnpm lint && pnpm coverage && pnpm build && pnpm verify:exports && pnpm verify:llms && pnpm check:sizewalks clean against a single placeholder test.- Coverage thresholds temporarily set to
0/0/0/0; tightened to95/90/100/100in 0.1.0 with real tests. - Size budget temporarily set to 3 KB gzip; tightened to the 2 KB README target in 0.1.0.
- Publish workflow exists but trigger is
workflow_dispatchonly — no accidental npm release on tag push until 0.1.0.