Contributing to Spandex

Thank you for your interest in contributing to Spandex!

Quick Links

New to the project?

Ready to contribute?

Development Workflow

1. Setting Up

git clone https://github.com/jimisaacs/spandex.git
cd spandex
deno task test  # Verify everything works

2. Making Changes

Before you start:

While developing:

deno task test           # Run tests
deno task test:watch     # Watch mode
deno task fmt            # Format code
deno task lint           # Lint code
deno task check          # Type check
deno task bench:update   # Update benchmarks (~2 min)

3. Pre-Commit Checklist

Before committing, ensure:

4. Commit Message Convention

<type>: <description>

Examples:
feat: add bulk insert optimization
fix: correct boundary handling in query
docs: update GETTING-STARTED with examples
test: add adversarial pattern coverage
perf: optimize Morton code calculation
refactor: simplify rectangle decomposition
chore: update dependencies

Adding a New Implementation

See IMPLEMENTATION-LIFECYCLE for detailed steps.

Summary:

  1. Create implementation in packages/@jim/spandex/src/index/
  2. Create test directory with property/geometry/visual tests
  3. Generate fixtures: UPDATE_FIXTURES=1 deno test -A
  4. Run benchmarks: deno task bench:update
  5. Document findings in docs/analyses/

Running Tests

# All tests
deno task test

# Specific implementation
deno task test:morton
deno task test:rstartree

# Adversarial patterns
deno task test:adversarial

# Update fixtures (after intentional test changes)
UPDATE_FIXTURES=1 deno test -A

Running Benchmarks

During Development (Quick Checks)

deno task bench         # Run benchmarks (~2 min)
deno task bench:update  # Update BENCHMARKS.md (~2 min)

Before Completing Tasks (Full Update)

⚠️ IMPORTANT: Both benchmark documentation files must be current before completing work:

deno task bench:update   # Updates BENCHMARKS.md (~2 min)
deno task bench:analyze 5 docs/analyses/benchmark-statistics.md  # Updates stats (~30 min) ⚠️

Warning: bench:analyze is VERY SLOW (20-30 minutes for 5 runs). Only run before completing/committing major changes. Use deno task bench (~2 min) for quick validation during development.

For detailed benchmarking workflows and when to use which command, see BENCHMARK-FRAMEWORK.

Code Style

Formatting: Enforced by deno fmt

Type Safety:

Imports:

// ✅ Good
import createMortonLinearScanIndex from '@jim/spandex/index/mortonlinearscan';

// ❌ Bad
import { createMortonLinearScanIndex } from '@jim/spandex';

Documentation

When to update:

Documentation style:

Research Workflow

For the complete experiment lifecycle (hypothesis → implementation → analysis → cleanup), see docs/active/README.md.

Questions?

License

By contributing, you agree that your contributions will be licensed under the MIT License.