Add CVE caches and ArrowSpace test fixture
Browse files- README.md +10 -0
- arrowspace-tests/controlled/CALIBRATION.md +87 -0
- arrowspace-tests/controlled/README.md +3 -0
- arrowspace-tests/controlled/eigenmaps_controlled.parquet +3 -0
- arrowspace-tests/controlled/make_datasets.py +49 -0
- cve/ATTRIBUTION.md +19 -0
- cve/README.md +23 -0
- cve/cache-neurips/cve_embeddings_cache.npy +3 -0
- cve/cache-neurips/cve_queries_emb_cache.npy +3 -0
- cve/cache-root/cve_embeddings_cache.npy +3 -0
- cve/cache-root/cve_ids_cache_ppx.npy +3 -0
- cve/cache-root/cve_queries_emb_cache.npy +3 -0
- cve/cache-root/cve_queries_pplx1b.npy +3 -0
README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ArrowSpace test and experiment datasets
|
| 2 |
+
|
| 3 |
+
This dataset repository holds selected local data assets used by ArrowSpace tests and CVE experiment prototypes. The directory layout intentionally separates the CVE-derived cache artifacts from the small deterministic test fixture.
|
| 4 |
+
|
| 5 |
+
## Contents
|
| 6 |
+
|
| 7 |
+
- `cve/` — attribution and cache artifacts used in prior local CVE experiments. See `cve/README.md` before combining files: cache dimensions differ and corpus/ID alignment has not been independently verified.
|
| 8 |
+
- `arrowspace-tests/controlled/` — a 1,000-row synthetic clustered fixture, its deterministic generator, and calibration notes. This is suitable for tests and smoke checks, not as a real retrieval benchmark.
|
| 9 |
+
|
| 10 |
+
The CVE records are maintained by the CVE Program and remain subject to the CVE Program Terms of Use. The controlled synthetic fixture was generated locally for ArrowSpace tests; see its calibration notes and generator. This repository does not contain the original CVE List V5 archive.
|
arrowspace-tests/controlled/CALIBRATION.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CALIBRATION — synthetic dataset for the `tests/test_0_*.py` scripts
|
| 2 |
+
|
| 3 |
+
Empirical findings from calibrating a shared controlled dataset against
|
| 4 |
+
`arrowspace==0.27.2` (pyarrowspace build, CPython 3.13, macOS arm64).
|
| 5 |
+
|
| 6 |
+
Final dataset: **`eigenmaps_controlled.parquet` — 1000 items x 128 dims**,
|
| 7 |
+
3 orthonormal clusters of increasing sparsity, with a `cluster` label column.
|
| 8 |
+
Regenerate with `uv run python tests/data/make_datasets.py` (seed 11).
|
| 9 |
+
|
| 10 |
+
## 1. Why the old tests failed
|
| 11 |
+
|
| 12 |
+
| Test | Failure | Root cause |
|
| 13 |
+
|---|---|---|
|
| 14 |
+
| `test_0_0`, `test_0_5` | `assert(hits[0][0] == 4)` at `tau<=0.9` | 5×24 dataset of near-identical rows → lambda spread is numerical noise, so the spectral term never reorders results. Expectations encoded 0.26-era lambdas; file last touched at v0.26.0. |
|
| 15 |
+
| `test_0_9` | `assert(len(hits) == 3)` | Contradicted build params `topk: 5`; 0.27.x correctly returns 5 hits. |
|
| 16 |
+
|
| 17 |
+
All three failed identically on 0.27.0 and 0.27.2 — pre-existing staleness,
|
| 18 |
+
not a regression from the version bump. The CI suite (`pytest-tests/`) passes
|
| 19 |
+
66/66 on 0.27.2.
|
| 20 |
+
|
| 21 |
+
## 2. 0.27.x scoring semantics (measured)
|
| 22 |
+
|
| 23 |
+
- `search(q, gl, tau)` score = `tau·cos(q, item) + (1−tau)·spec(item)`
|
| 24 |
+
(**blend model confirmed exactly**: predicted vs actual orders matched on
|
| 25 |
+
every probed config).
|
| 26 |
+
- `spec` is **not** `λi` directly: the query is placed into the graph and gets
|
| 27 |
+
its **own lambda** `λq` (`prepare_query_item`); `spec` measures spectral
|
| 28 |
+
closeness between `λq` and the item's `λi`. The shape is nonlinear — do not
|
| 29 |
+
model it, measure it: `search(q, gl, 0.0, k=n)` (tau=0 ⇒ score IS spec).
|
| 30 |
+
- `q = items[j] * scale` is cosine-invariant (`cos(q, items[j]) = 1.0` for any
|
| 31 |
+
`scale > 0`), but `λq` moves with `scale` — the only query-side tuning knob.
|
| 32 |
+
- `q = items[j]` exactly (scale 1.0) raises `ValueError: degenerate lambda
|
| 33 |
+
(raw=0.000000)`. Always scale the query (e.g. 1.05–1.2).
|
| 34 |
+
- `aspace.lambdas()` are min-max normalized: exactly one item shows `0.0`
|
| 35 |
+
(the floor). Harmless — the degenerate gate only fires for a query's own
|
| 36 |
+
lambda. Quality gate: `count(λ < 1e-12) <= 1` for these datasets.
|
| 37 |
+
- `eps=0.05` (the old tests' value) leaves high-dim unit-norm data
|
| 38 |
+
near-disconnected. These datasets use `eps=0.5, sigma=0.5`.
|
| 39 |
+
- Dense noise σ drives λ per item, roughly quadratically; sparse 2-dim spikes
|
| 40 |
+
give far less λ per L² (L²=0.078 → λ=0.032 vs dense σ=0.02 curve).
|
| 41 |
+
- Lifting an item past a cos-1.0 self-anchor at tau=0.9 needs
|
| 42 |
+
`0.1·Δspec > 0.9·(1−cos)` — a 9× barrier; naive twin-item designs sit right
|
| 43 |
+
on it (see sweep log). Cluster-level invariants are far more robust.
|
| 44 |
+
|
| 45 |
+
## 3. Final dataset design (1000 x 128, seed 11)
|
| 46 |
+
|
| 47 |
+
3 clusters with orthonormal centroids (QR of random Gaussian), unit-norm rows:
|
| 48 |
+
|
| 49 |
+
| cluster | items | noise σ | mean λ (build_and_store) |
|
| 50 |
+
|---|---|---|---|
|
| 51 |
+
| 0 (dense) | 400 | 0.02 | 0.0451 |
|
| 52 |
+
| 1 (medium) | 350 | 0.05 | 0.1109 |
|
| 53 |
+
| 2 (sparse) | 250 | 0.12 | 0.1372 |
|
| 54 |
+
|
| 55 |
+
Graph params for all variants: `eps=0.5, k=12, p=2.0, sigma=0.5`;
|
| 56 |
+
`topk=3` (tests 0_0, 0_5) / `topk=5` (test 0_9).
|
| 57 |
+
|
| 58 |
+
Query: `items[0] * 1.2` (dense-cluster member, scaled — never exact).
|
| 59 |
+
|
| 60 |
+
### Verified invariants (all three builder variants)
|
| 61 |
+
|
| 62 |
+
- `build_and_store` and `build_full` produce identical results.
|
| 63 |
+
- Sampled builder must use `with_sampling("simple", 1.0)` for a small
|
| 64 |
+
dataset (0.6 changes the graph; 1.0 keeps all items).
|
| 65 |
+
- Cluster containment: every hit at every `tau ∈ {1.0, 0.9, 0.6, 0.55}` is
|
| 66 |
+
from the query's own cluster.
|
| 67 |
+
- Self item ranks first at every tau.
|
| 68 |
+
- Mean λ increases with cluster sparsity: `λ̄₀ < λ̄₁ < λ̄₂` (the spectral
|
| 69 |
+
statistic tracks structural density).
|
| 70 |
+
- Exactly one min-max zero λ.
|
| 71 |
+
- Bonus: within the dense cluster, tau ≤ 0.6 reorders the runner-ups
|
| 72 |
+
(spectral blending active) — observed, not asserted (brittle).
|
| 73 |
+
|
| 74 |
+
## 4. Sweep log (calibration journey, kept for reference)
|
| 75 |
+
|
| 76 |
+
| Stage | Dataset | Outcome |
|
| 77 |
+
|-------|---------|---------|
|
| 78 |
+
| probe (d=24) | 5 handcrafted rows | spec ≈ λ-closeness to query's λ discovered; exact-self query is degenerate |
|
| 79 |
+
| v2–v7 (d=60) | 5 twin/filler rows | 9× cosine-economics barrier; min-max λ floor; fillers hijack at scale ≥ 1.6; linear spec model insufficient at large offsets |
|
| 80 |
+
| measurement | d=60 twins | blend model `tau·cos + (1−tau)·spec` CONFIRMED via tau=0 spec extraction; winner found for [2,1,4]→[1,2,4] |
|
| 81 |
+
| final | 1000×128 clusters | cluster-level invariants: robust on every builder variant; adopted |
|
| 82 |
+
|
| 83 |
+
## 5. File inventory
|
| 84 |
+
|
| 85 |
+
- `eigenmaps_controlled.parquet` — the shared dataset (features `f0..f127` + `cluster`).
|
| 86 |
+
- `make_datasets.py` — deterministic generator.
|
| 87 |
+
- `CALIBRATION.md` — this document.
|
arrowspace-tests/controlled/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Controlled ArrowSpace fixture
|
| 2 |
+
|
| 3 |
+
`eigenmaps_controlled.parquet` contains the synthetic 1,000 × 128 clustered feature fixture used by the local ArrowSpace `test_0_*` scripts. `make_datasets.py` documents/regenerates the synthetic data; `CALIBRATION.md` records the design and observed calibration behavior. This is a software test fixture, not an externally sourced benchmark dataset.
|
arrowspace-tests/controlled/eigenmaps_controlled.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a305905181f38313dfd79f02b6ab03a136647a4d2e01362b583bb9f6761770a9
|
| 3 |
+
size 1253963
|
arrowspace-tests/controlled/make_datasets.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Generates the shared parquet dataset used by tests/test_0_*.py.
|
| 3 |
+
|
| 4 |
+
Dataset is deterministic (fixed seed). Regenerate with:
|
| 5 |
+
uv run python tests/data/make_datasets.py
|
| 6 |
+
|
| 7 |
+
Design (see CALIBRATION.md): 1000 items x 128 dims in 3 orthonormal clusters
|
| 8 |
+
of increasing sparsity. Dense clusters get low lambdas, sparse clusters high
|
| 9 |
+
lambdas — the spectral statistic tracks structural density.
|
| 10 |
+
"""
|
| 11 |
+
import os
|
| 12 |
+
|
| 13 |
+
import numpy as np
|
| 14 |
+
import pandas as pd
|
| 15 |
+
|
| 16 |
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
| 17 |
+
|
| 18 |
+
D = 128
|
| 19 |
+
CLUSTER_SIZES = (400, 350, 250) # dense, medium, sparse
|
| 20 |
+
CLUSTER_SIGMA = (0.02, 0.05, 0.12)
|
| 21 |
+
SEED = 11
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def make_clustered(seed=SEED, d=D, sizes=CLUSTER_SIZES, sigmas=CLUSTER_SIGMA):
|
| 25 |
+
rng = np.random.default_rng(seed)
|
| 26 |
+
raw = rng.standard_normal((len(sizes), d))
|
| 27 |
+
Q, _ = np.linalg.qr(raw.T) # orthonormal 128-dim centroids
|
| 28 |
+
centroids = Q.T
|
| 29 |
+
|
| 30 |
+
rows, labels = [], []
|
| 31 |
+
for c, (n, sig) in enumerate(zip(sizes, sigmas)):
|
| 32 |
+
X = centroids[c][None, :] + sig * rng.standard_normal((n, d))
|
| 33 |
+
X /= np.linalg.norm(X, axis=1, keepdims=True)
|
| 34 |
+
rows.append(X)
|
| 35 |
+
labels.append(np.full(n, c))
|
| 36 |
+
return np.vstack(rows).astype(np.float64), np.concatenate(labels)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def save_parquet(items: np.ndarray, labels: np.ndarray, name: str):
|
| 40 |
+
df = pd.DataFrame(items, columns=[f"f{i}" for i in range(items.shape[1])])
|
| 41 |
+
df["cluster"] = labels.astype(np.int64)
|
| 42 |
+
path = os.path.join(HERE, name)
|
| 43 |
+
df.to_parquet(path, index=False)
|
| 44 |
+
print(f"wrote {path} shape={items.shape}")
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
if __name__ == "__main__":
|
| 48 |
+
items, labels = make_clustered()
|
| 49 |
+
save_parquet(items, labels, "eigenmaps_controlled.parquet")
|
cve/ATTRIBUTION.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CVE data ownership and attribution
|
| 2 |
+
|
| 3 |
+
The CVE-derived materials in this directory originate from local ArrowSpace experiments using CVE List V5 data. CVE records are maintained by the CVE Program. The cached numerical arrays are embeddings and query artifacts derived from or used with that source; they are not the original CVE records. Their exact cache-to-record and cache-to-ID alignment has not been independently verified. The original CVE List archive is not redistributed here.
|
| 4 |
+
|
| 5 |
+
**Copyright © 1999–2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation.**
|
| 6 |
+
|
| 7 |
+
## CVE Program Terms of Use — License
|
| 8 |
+
|
| 9 |
+
> MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE ™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.
|
| 10 |
+
|
| 11 |
+
Source: [CVE Program Terms of Use](https://www.cve.org/legal/termsofuse).
|
| 12 |
+
|
| 13 |
+
## Disclaimer
|
| 14 |
+
|
| 15 |
+
The CVE materials and information are provided on an “AS IS” basis. The CVE Program Terms of Use disclaim express and implied warranties, including warranties of title, non-infringement, merchantability, and fitness for a particular purpose. Consult the linked terms for the complete current legal text.
|
| 16 |
+
|
| 17 |
+
## Provenance
|
| 18 |
+
|
| 19 |
+
The local ArrowSpace experiment documentation identifies the source as CVE List V5, version `2026-04-29_all_CVEs_at_midnight.zip`, from the [CVEProject/cvelistV5 release](https://github.com/CVEProject/cvelistV5/releases/tag/cve_2026-04-29_1800Z). That source/version attribution comes from the local `neurips/CVE/README.md`; it does not establish row-level provenance for every cached array in this folder.
|
cve/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CVE experiment cache artifacts
|
| 2 |
+
|
| 3 |
+
See [`ATTRIBUTION.md`](ATTRIBUTION.md) for required CVE ownership notice and terms.
|
| 4 |
+
|
| 5 |
+
These files were collected from distinct local cache locations. They are intentionally grouped by source path, not asserted to form one aligned dataset:
|
| 6 |
+
|
| 7 |
+
## `cache-root/`
|
| 8 |
+
|
| 9 |
+
| File | Local NPY shape | dtype | Notes |
|
| 10 |
+
|---|---:|---|---|
|
| 11 |
+
| `cve_embeddings_cache.npy` | 335,462 × 384 | float64 | Large local embedding cache. |
|
| 12 |
+
| `cve_ids_cache_ppx.npy` | 92,694 | object | Count does not match the 335,462 embedding rows. Do not join by row position without an independent mapping. Load only from a trusted source; NumPy object arrays may require pickle. |
|
| 13 |
+
| `cve_queries_emb_cache.npy` | 18 × 384 | float64 | 384-dimensional query cache. |
|
| 14 |
+
| `cve_queries_pplx1b.npy` | 18 × 1,024 | float64 | Separate 1,024-dimensional query cache; not compatible with the 384-dimensional corpus cache. |
|
| 15 |
+
|
| 16 |
+
## `cache-neurips/`
|
| 17 |
+
|
| 18 |
+
| File | Local NPY shape | dtype | Notes |
|
| 19 |
+
|---|---:|---|
|
| 20 |
+
| `cve_embeddings_cache.npy` | 50 × 384 | float64 | Separate local cache at `neurips/CVE/`. |
|
| 21 |
+
| `cve_queries_emb_cache.npy` | 50 × 384 | float64 | Separate query cache at `neurips/`; row pairing with the other file has not been independently checked. |
|
| 22 |
+
|
| 23 |
+
Local paths were under `~/code/pyarrowspace`. These files are preserved as distinct cache snapshots because their dimensions differ; no claim is made that the root and NeurIPS caches are interchangeable. Use the small controlled fixture under `arrowspace-tests/controlled/` for a deterministic smoke test that does not depend on these caches.
|
cve/cache-neurips/cve_embeddings_cache.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3fecd858e6c5e8204e64cc7839dbd966322ffc51428c48d46930f6a9a90cc523
|
| 3 |
+
size 153728
|
cve/cache-neurips/cve_queries_emb_cache.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc60deb573fdeb3ac2d9ee174f9a6c1b6911ac7dfa99c52d11e5c025474c1dda
|
| 3 |
+
size 153728
|
cve/cache-root/cve_embeddings_cache.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bee11154820bb606fe27e86e78c9c834e73a715ba0e9e49e2bf7a71d22cb3573
|
| 3 |
+
size 1030539392
|
cve/cache-root/cve_ids_cache_ppx.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77f83ccaa1881a8ab59cce59942f3035d1b58234969af08ab73d8893d1df94fa
|
| 3 |
+
size 1527813
|
cve/cache-root/cve_queries_emb_cache.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c7e624d58d59532b2aacd8b67ddeb9375ddc30ed3010d7d44bb5972925bfbd3
|
| 3 |
+
size 55424
|
cve/cache-root/cve_queries_pplx1b.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce0068f503917b3ea6f38d2610913daf6b0898e0ccfd348e5174f26fd62b6b6f
|
| 3 |
+
size 147584
|