Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions docs/convergence-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Convergence Report

Standing invariants: all green.

## Recovered from interrupted wrap

Previous session completed 🎯T2 implementation: added `reflect.Kind` dispatch for int/float/string fast-paths in `resolveHashFunc`, `resolveSeededHashFunc`, and `EqualFuncFor`. All read benchmarks confirmed 0 allocs/op. Changes are uncommitted and need to go through PR flow.

## Movement

- 🎯T2: not started → close (implementation complete, uncommitted)
- 🎯T3: (unchanged)

## Gap report

### 🎯T2 All read operations are zero-alloc [weight 5, effective 4.0]
Gap: close
All acceptance criteria met in code: Map.Get, Map.Has, Set.Has all report 0 B/op, 0 allocs/op at 1k and 1M sizes. Tests pass. Not yet committed or delivered (no PR).

Implied: not yet delivered (changes uncommitted, no PR)

### 🎯T3 No-op write operations are zero-alloc [weight 3, effective 2.5]
Gap: not started (status only)
No work started. No changed-file overlap.

## Recommendation

Work on: **🎯T2 All read operations are zero-alloc**
Reason: Highest effective weight (4.0), code is done, just needs delivery. Closing this is nearly free.

## Suggested action

Commit the uncommitted changes and run `/push` to create a PR and drive it through CI.

Type **go** to execute the suggested action.

<!-- convergence-deps
evaluated: 2026-03-08T14:00:00Z
sha: 431cd1c

🎯T2:
gap: close
assessment: "All read benchmarks 0 allocs/op. reflect.Kind dispatch implemented. Uncommitted, needs PR."
read:
- internal/pkg/tree/hasher.go
- internal/pkg/value/value.go
- map_test.go
- set_test.go

🎯T3:
gap: not started
assessment: "No work started."
read: []
-->
25 changes: 13 additions & 12 deletions docs/targets.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
# Targets

<!-- last-evaluated: 431cd1c -->
<!-- last-evaluated: bf5e07b -->

## Active

### 🎯T2 All read operations are zero-alloc
- **Weight**: 5 (value 8 / cost 2)
- **Estimated-cost**: 2
- **Acceptance**:
- `Map.Get`, `Map.Has`, `Set.Has` report 0 B/op, 0 allocs/op in benchmarks at 1k and 1M sizes
- No regression in throughput (ns/op must not increase)
- All existing tests pass
- **Context**: Currently 1 alloc/op remains in Map.Get from `resolveSeededHashFunc` fallback boxing `int` through `hash.Any(key, seed)`. Adding an `int` fast-path (like the existing `string` and `float64` paths) would eliminate it. Similar pattern applies to other common key types.
- **Status**: identified
- **Discovered**: 2026-03-08

### 🎯T3 No-op write operations are zero-alloc
- **Weight**: 3 (value 5 / cost 2)
- **Estimated-cost**: 2
Expand All @@ -31,6 +20,18 @@

## Achieved

### 🎯T2 All read operations are zero-alloc
- **Weight**: 5 (value 8 / cost 2)
- **Estimated-cost**: 2
- **Acceptance**:
- `Map.Get`, `Map.Has`, `Set.Has` report 0 B/op, 0 allocs/op in benchmarks at 1k and 1M sizes
- No regression in throughput (ns/op must not increase)
- All existing tests pass
- **Context**: Used reflect.Kind dispatch in resolveHashFunc, resolveSeededHashFunc, and EqualFuncFor to catch derived types and route through direct hash/equality functions. Added size-based integer fast-paths to resolveSeededHashFunc.
- **Status**: achieved
- **Discovered**: 2026-03-08
- **Achieved**: 2026-03-08

### 🎯T1 Map[K,V] hot-path operations avoid per-call allocations
- **Weight**: 5 (value 8 / cost 2)
- **Estimated-cost**: 2
Expand Down
Loading