Skip to content
Skills Library
Programming · Analysis

wax-performance-audit

/wax-performance-audit

Benchmarking and performance auditing for the Wax repo. Use when running or interpreting Wax benchmarks, diagnosing CPU, memory, or I/O bottlenecks, or investigating Swift 6.2 concurrency issues such as Sendable, actor isolation, `@unchecked Sendable`, task-group fan-out, and data races.

Repository
wax ↗
Licence
Apache-2.0
Last repository change
26.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.09.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Benchmarking and performance auditing for the Wax repo. Use when running or interpreting Wax benchmarks, diagnosing CPU, memory, or I/O bottlenecks, or investigating Swift 6.2 concurrency issues such as Sendable, actor isolation, `@unchecked Sendable`, task-group fan-out, and data races.

Original author description

Benchmarking and performance auditing for the Wax repo. Use when running or interpreting Wax benchmarks, diagnosing CPU, memory, or I/O bottlenecks, or investigating Swift 6.2 concurrency issues such as Sendable, actor isolation, `@unchecked Sendable`, task-group fan-out, and data races.

How it works

  1. Overview
  2. Workflow
  3. Benchmark Selection
  4. Bottleneck Triage
  5. Swift 6.2 Concurrency
  6. Reporting
Original SKILL.md headings · 76 lines, 457 words
SKILL.md preview
---
name: wax-performance-audit
description: Benchmarking and performance auditing for the Wax repo. Use when running or interpreting Wax benchmarks, diagnosing CPU, memory, or I/O bottlenecks, or investigating Swift 6.2 concurrency issues such as Sendable, actor isolation, `@unchecked Sendable`, task-group fan-out, and data races.
---

# Wax Performance Audit

## Overview

Use this skill to benchmark Wax changes, isolate the hottest code path, and separate real regressions from noisy samples.

The repo builds with Swift 6.1 and `StrictConcurrency` enabled, so audit for Swift 6.2 concurrency risks without assuming 6.2-only language mode.

## Workflow

1. Name the symptom precisely: latency regression, memory growth, file bloat, or Swift concurrency diagnostics.
2. Pick the narrowest benchmark or test file that exercises the path.
3. Run a baseline and candidate with the same environment and scale.
4. Collect wall time plus memory or file-growth metrics when the issue is not purely CPU-bound.
5. Inspect the smallest relevant actor boundary, task group, cache, or I/O path.
6. Report the evidence, the bottleneck, and the smallest safe fix.

## Benchmark Selection

Use [`references/benchmark-workflow.md`](references/benchmark-workflow.md) for the command matrix, environment flags, and benchmark map.

Prefer these repo entry points when they match the symptom:

- `Tests/WaxIntegrationTests/RAGBenchmarkSupport.swift`
- `Tests/WaxIntegrationTests/RememberDedupBenchmarks.swift`
- `Tests/WaxIntegrationTests/StoreBloatBenchmarks.swift`
- `Tests/WaxIntegrationTests/RAGBenchmarks.swift`
- `Tests/WaxIntegrationTests/RAGBenchmarksMiniLM.swift`
- `Tests/WaxIntegrationTests/BatchEmbeddingBenchmark.swift`
- `Tests/WaxIntegrationTests/SessionRuntimeStatsBenchmarks.swift`
- `Tests/WaxIntegrationTests/WALCompactionBenchmarks.swift`
- `Tests/WaxIntegrationTests/HandoffLookupBenchmarks.swift`
- `Tests/WaxIntegrationTests/PayloadLivenessBenchmarks.swift`
- `Tests/WaxIntegrationTests/SurrogateSourceBenchmarks.swift`
- `Tests/WaxIntegrationTests/AccessStatsBootstrapBenchmarks.swift`
- `Tests/WaxIntegrationTests/ConcurrencyStressTests.swift`
- `Tests/WaxIntegrationTests/MemoryOrchestratorTests.swift`
- `Tests/WaxArcticTests/ArcticPerformanceBenchmark.swift`
- `Tests/WaxCoreTests/ReadWriteLockTests.swift`
- `Tests/WaxCoreTests/AsyncMutexTests.swift`

## Bottleneck Triage

- CPU: look for repeated serialization, unnecessary sorting, extra actor hops, and oversized batch work.
- Memory: compare RSS, allocated bytes, dead payload bytes, TOC growth, and frame count.
- I/O: inspect WAL compaction, reopen cost, and close-time rewrite work.
- Embeddings: check compute unit selection, batch sizing, and warmup or prewarm behavior.
- Noise: rerun if caches are cold, an external compiler/service is active, or the benchmark has low sample counts.
- Gated skips: confirm the env flag actually enabled the lane before treating a skip or pass as evidence.
- Harness plumbing: `measureAsync` in `RAGBenchmarkSupport.swift` uses `DispatchSemaphore` plus `Task` because XCTest measurement is synchronous; do not confuse that with production concurrency.
- ANE/GPU: CPU-only benchmark paths are intentional in some suites, and warm p95/p99 values can be noisy when `ANECompilerService` or similar background work is active.

## Swift 6.2 Concurrency

Use [`references/concurrency-checklist.md`](references/concurrency-checklist.md) when the change touches actors, task groups, `Sendable`, or `@unchecked Sendable`.

Default checks:

- Trace every value that crosses an actor boundary.
- Prefer `@Sendable` closures that capture immutable values.
- Treat `@unchecked Sendable` as a deliberate exception, not a default.
- Watch task groups for hidden fan-out that increases memory pressure.
- Keep blocking I/O off actor executors.
- Verify `@MainActor` crossings in UI-adjacent or Photos code.
- Treat `@preconcurrency` interop and `@unchecked Sendable` around CoreML, GRDB, Photos, and tokenizer internals as review hotspots, not automatic bugs.

## Reporting

When you finish, state:

- the benchmark or test you ran,
- the before/after evidence,
- whether the regression was CPU, memory, I/O, or concurrency-related,
- and the exact file or subsystem that caused it.
Files in this package (4)
  • SKILL.md 4 KB
  • agents/openai.yaml 1 KB
  • references/benchmark-workflow.md 4 KB
  • references/concurrency-checklist.md 3 KB

Versions

The database has no other skills named wax-performance-audit.

Database snapshot: 13.11.2026 · package version 8cfcf81d6b07 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100wax
    Swift client guidance for Wax's public Memory, PhotoMemory, and VideoMemory APIs. Use only when writing or changing Swift app code that imports Wax. Do not use at session start. Do not use for MCP remember/recall/stats — those follow the live MCP server instructions. Do not use…
  • 95swift-concurrency
    Diagnose data races, convert callback-based code to async/await, implement actor isolation patterns, resolve Sendable conformance issues, and guide Swift 6 migration. Use when developers mention: (1) Swift Concurrency, async/await, actors, or tasks, (2) "use Swift Concurrency"…
  • 100swift-concurrency-expert
    Diagnoses and fixes Swift concurrency problems: data-race-safety errors in the Swift 6 language mode, actor isolation, Sendable, moving work off the main actor, and wrapping callback APIs in async functions. Reads the target's build settings first, because default isolation and…
  • 100swift-6-migration
    Use when encountering Swift 6 concurrency errors, Sendable conformance warnings, actor isolation issues, "global variable is not concurrency-safe" errors, or migrating codebases to Swift 6 language mode
  • 100swift-concurrency
    Use when diagnosing Swift Concurrency issues, refactoring callback-based code to async/await, or migrating to Swift 6 - tasks, actors, @MainActor, Sendable, data races and isolation errors.
  • 95swift-concurrency
    Expert guidance on Swift Concurrency concepts. Use when working with async/await, Tasks, actors, MainActor, Sendable, isolation domains, or debugging concurrency compiler errors. Helps write safe concurrent Swift code.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.