st: retain tensor shapes and shard sizes - #802
Conversation
|
@JustVugg, could you please approve the fork workflow runs for the current
This head adds the Windows/POSIX subprocess regression coverage for hostile shapes described in the PR body. I will use the actual job results, not the body, as CI evidence. |
|
CI approved and running — it had never started. GitHub was holding the workflow in This is exactly the PR I asked for on #165, and it is scoped the way I hoped: Two things I want to say properly while the checks run. I was wrong about Retaining The shape validation is the half I did not ask for and would have missed. Refusing non-numeric, fractional, negative, over-rank and product-overflowing dimensions before storing them closes a path where a hostile or corrupt mirror could put an absurd geometry into the index and have it believed by whatever reads it later. Accepting rank 8, scalar I will watch Windows in particular: your shape tests drive One note for after: your branch already carries its own |
Summary
ST_MAX_RANK=8)fds[]andpaths[]fstatresultWhy
st_tensorcurrently keeps onlynumel, so engines cannot validate the original tensor geometry after indexing. The shard size used for the initial bounds check is also discarded, which prevents later range diagnostics from using the same indexed fact.This is the shared
st.hprerequisite discussed on #165. It deliberately does not add the V4 engine, a per-tensor shard field, or model-specific aliases.sizes[512]costs 4 KiB once per model index.Tests
test_st_shapevalidates non-numeric, fractional, negative, dimension-bound, product-overflow, and rank>8 refusals in subprocesses on Windows and POSIXtest_st_shapealso accepts rank 8, scalar[](rank=0,numel=1), and zero-element[0,4096]shapes with exact stored metadatatest_st_pread,test_st,test_st_mirror, andtest_ue8m0pass on Windows/UCRT64make -C c checkPYTHONUTF8=1on Windows)Related: #165