Fix tests and add runner script#65
Open
nvlukasz wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR gets the
neon/py/testssuite green and runnable as a single suite. It ports the tests off the obsoletewpnemodule, fixes API drift against the currentneonPython package, converts the standalone test scripts into discoverableunittesttests, and fixes the underlying Neon bugs the tests surfaced (inbGrid,DataView, and thebField/Containerwrite path). All functional tests now pass (18/18).Test suite changes
Removed the obsolete
wpnedependencywpnewas the old standalone Warp↔Neon glue package; its functionality now lives in theneonpackage itself (neon.Container,neon.Loader,neon.init). Tests now import directly fromneonand useinit_warp_neon()instead of thewpnescaffolding (import wpne,@require_wpne,setup_wpne_build). The now-unusedwpnehelpers were dropped fromneon_test_utils.py.Fixed API drift against the current
neonpackagemGrid.new_field()now requiresmemory_type=→ addedneon.MemoryType.host_device()mGrid.get_num_levels()→.num_levels(now a property)@Container.factory→@Container.factory()(now takes anameargument)NeonDenseIdx_create→neon_idx_3d;NeonDenseSpan_print/neon_print(partition)→neon_print/neon_print_dbg;neon_ngh_data→neon_read_nghConverted scripts to
unittestand standardized thetest_*prefixblock_grid.pyandmres_grid.pywere alreadyunittest-based and were simply renamed. The remaining scripts (axpy,jacobi,mres_*) were wrapped in a@require_gpu-gatedTestCasewhosetest_runcalls the original entry point —axpy/jacobikeep their correctness assertions; themres_*demos act as smoke tests.benchmark_axpy.pywas intentionally left as a standalone perf script.Added
run_tests.shEach test file runs in its own process: a single-process
python -m unittest discoversegfaults because Warp + Neon re-initialize global GPU state (CUDA contexts, kernel cache) on every test. The runner sourcesenv.shand honors$PYTHON.Neon fixes required to make the tests pass
bGridcontainers (Container.cpp,block/bGrid.py):bGridlacked anameproperty (whichContainer.__init__reads) and was missing thewarp_container_{delete,run,parse}_bGridC exports (onlydGrid/mGridwere exported). Added both.DataViewcodegen (dataView.py): a capturedDataViewconstant generated invalid C++ (wp::NeonDataView{{/* !!! */}}) because Warp's serializer didn't recognize itsctypes.c_charfield. Changed the field toctypes.c_int8(same 1-byte layout) so it emits a validwp::NeonDataView{N}.bFieldwrite path (bField_imp.h,mGrid.cpp): writing to an inactive cell aborted the process withstd::out_of_range.bField::getReferencenow guardssetIdx == -1(matching the read path) and throws a clearNeonException, and themGrid_mField_writebinding catches it and returns-1instead of crossing theextern "C"boundary.How to run
neon/py/tests/run_tests.sh # 18 passed, 0 failedIndividual tests also run via