tests: cover ViewTable bounds, sampled_table_neighbor, and resolve_view_table #3758
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3758
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3756"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ammmae0x on GitHub · 2026-12-01 16:15 UTC · original
Ammmae0x:tests/logical-view-table-unit→main· +1241 −0 · 5 files · 1 commits · merged 2026-12-01 17:05 UTCRefs #1149.
Standalone portable C++17 unit + 1:1 header-mutation tests for
x2w_startup::ViewTable,sampled_table_neighbor, andresolve_view_table(src/startup_stubs/logical_view_table.h), with zero edits to existing files (5 new files only, +1241/-0).tests/startup_logical_view_table_check.cpp,tests/sampled_table_neighbor.cpp, andCMakeLists.txtare untouched; the disjointlogical_view_table_unitprefix keeps test names disjoint.What landed — commit
ddf61d4e, in thelogical-view-table-unitworktree fromorigin/main959306d4; main clone untouched.tests/logical_view_table_unit_check.cppcovers 11 cases (CLI--case/<name>+ all):record_zero_address: zero address gives no record at any offset/size; defaultViewTable{}; zero-byte table gives only the empty record at offset zero.record_bounds: records inside a 128-byte window, exact-end records, an empty record at the exact end (offset == bytes && size == 0returnsaddress + bytes),offset > bytesrefused even when empty, one-byte crossings refused.record_overflow:size > bytes - offsetrefused even whensize <= bytes(96/64, 64/65, 32/97), with exact-boundary records valid;SIZE_MAX/UINT64_MAXsizes andUINT64_MAXoffsets refuse without wrapping.neighbor_zero_increment:increment == 0absent in either direction at any offset, readable never invoked.neighbor_underflow_overflow: backward underflow (offset < increment) absent without invoking readable;offset == incrementis not underflow and decodes the first record; forward overflow (offset > UINT64_MAX - increment) absent without invoking readable.neighbor_bounds_readable: a 12-byte record in an 11-byte table, a neighbour atoffset == bytes, and a next neighbour past a 24-byte table are absent without invoking readable;readable == falseinvokes the probe exactly once with the exact pointer and 12 bytes, prev and next.neighbor_valid_words: valid prev/next neighbours decode all threeuint32_twords ({10,20,30},{40,50,60},{70,80,90}), plus increment-4 prev decoding{30,40,50}.resolve_zero_fields: each zerogpu/cpu/stride/countalone and all together resolve to nothing.resolve_cpu_overflow:cpu > UINT64_MAX - bytesrefused; exact top boundarycpu == UINT64_MAX - bytesresolves to the full table; same guard for the largest heap (UINT_MAX * UINT_MAXbytes).resolve_handle_offset:handle < gpurefused (incl. below a top-of-address heap),offset >= bytesrefused incl.offset == bytes,offset % stride != 0refused.resolve_valid_narrowing: base handle{cpu, bytes}, mid-table handles narrow to{cpu + offset, bytes - offset}, and a 64-bitcount * strideproduct above 4 GiB (134217729 x 32 = 4294967328 bytes) resolves and narrows the same way.Mutation controls — 6
WILL_FAIL TRUEBEFORE PRIVATECMake header mutations, mirrored 1:1 in the meta check:record_overflow(size guard againstbytesnotbytes - offset),neighbor_underflow(off-by-one<to<=),neighbor_zero_inc(dropped!incrementguard),resolve_cpu_overflow(droppedcpuguard),resolve_align_mod(dropped% strideguard),resolve_narrow_bytes(kept fullbytesinstead ofbytes - offset).Verification (Linux, this host)
PASS: logical_view_table_unit: 11 cases, 6/6 mutations killed (g++)100% tests passed, 0 tests failed out of 18(11 cases +all+ 6WILL_FAILcontrols)form_coverage_check.py: pass;docs_links_check.py: 208 files / 802 links pass;bidi_controls_check.py: 2827 files pass;git diff --check: clean; merge-tree exits 0run_checks_parallel.py(full python-linux suite):all 299 checks passedCaveat: no mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter. Windows verification pending on
ddf61d4e(MSVC CTest^logical_view_table_unit).Windows Verification (
ddf61d4e)git merge-tree --write-tree upstream/main HEAD->d0e1e584(exit 0),git diff --check upstream/main...HEADcleanpy_compile,form_coverage_check.py,docs_links_check.py(209 files, 806 links),bidi_controls_check.py(2830 files),logical_view_table_unit_meta_check.py(cl:11 cases, 6/6 mutations killed) passeddev18/18 passed (1.03s);release18/18 passed (0.99s); directlogical_view_table_unit_check.exe(dev&release):PASS: logical_view_table_unit: 11/11 cases passed. AI-assisted.