Commit f7228a4
committed
refactor(core.utils): raw-binary filestream cache, drop SQLite + pickle
* Delete SQLiteProgramCache entirely; FileStreamProgramCache is the only
backend. Drops the sqlite3 import and ~500 lines of WAL/VACUUM/eviction
plumbing.
* Cache stores raw binary verbatim (no pickle, no JSON, no record header)
so entry files are directly consumable by external NVIDIA tools
(cuobjdump, nvdisasm, cuda-gdb, ...).
* API is bytes-in / bytes-out: cache[key] = value accepts bytes-like or
ObjectCode (path-backed too -- the file is read at write time so the
cache always holds the binary content, not a path); cache[key] returns
bytes. Callers reconstruct ObjectCode themselves with the code_type
they already know. symbol_mapping is intentionally not preserved.
* Eviction is now true LRU by st_atime: every successful read calls
os.utime(path, ns=(now, mtime_ns)) to bump atime regardless of mount
options or NTFS LastAccess defaults. Replaces the previous st_mtime
sort (effectively FIFO).
* Default cache directory follows OS conventions when path is omitted:
$XDG_CACHE_HOME/cuda-python/program-cache (Linux),
~/Library/Caches/cuda-python/program-cache (macOS), or
%LOCALAPPDATA%\cuda-python\program-cache (Windows).
* Bump _FILESTREAM_BACKEND_SCHEMA 2 -> 3 so existing pickle-format caches
are wiped on first open.
* Tests rewritten: drop SQLite suite, drop pickle/corruption tests,
add atime-LRU regression, add path-backed-accept regression, add
raw-binary on-disk regression, add multiprocess eviction-race test
(rewriter vs. churner) for the stat-guarded eviction path.1 parent 61469c1 commit f7228a4
5 files changed
Lines changed: 431 additions & 1194 deletions
File tree
- cuda_core
- cuda/core/utils
- docs/source
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
0 commit comments