Conversation
3b83227 to
b48c793
Compare
|
The test failures seem to be pre-existing. Please take a look at this PR, @hfattahi @bhawkins @xhuang-jpl. |
Layers whose raster was never requested (e.g. the ground-to-satellite east/north components, which nisar.workflows.rdr2geo always disables) are left with size-0 valarrays by setBlockSize. writeData() unconditionally took &valarray[0] for every layer to build the variant list, which is out-of-bounds when the valarray is empty. This undefined behavior aborts under libstdc++ builds with bounds-checked valarray::operator[], crashing the Python interpreter during test.python.pkg.nisar.workflows.rdr2geo. Only take the address when the valarray is non-empty; the existing per-raster nullptr guard in the write loop already lines up with each valarray's resize condition. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The LUT2d-Doppler overload of geo2rdr uses the incoming aztime value as its initial azimuth time guess rather than always performing its own coarse search. The test left aztime uninitialized, so it relied on whatever garbage happened to be on the stack; that value must fall within the orbit's time span and the Doppler LUT2d's valid domain, or the very first iteration fails with an out-of-bounds lookup. This was silently working by chance until a toolchain change altered the stack layout, causing OutOfBoundsLookup and a spurious test failure. Initialize aztime to orbit.midTime(), which is guaranteed to satisfy both constraints. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
est_xyz_eaz/eoa/aoe/tp were reserve()'d instead of resize()'d before being indexed, leaving size() at 0. Newer libstdc++ bounds-checking in operator[] catches this and aborts test.cxx.isce3.antenna.frame.
dryTropoDelayTSX() binds Eigen (Vec3) arguments but this file never included pybind11/eigen.h, so Vec3 resolved to the generic type_caster_base here instead of the Eigen/numpy specialization used elsewhere (e.g. slantRangeFromLookVec in pntintersect.cpp, which shares the exact same argument types). That is an ODR violation: two translation units instantiate the same pybind11 internal template with genuinely different content. It was apparently harmless under pybind11 2.x, but crashes import on pybind11 3.x with an internal type-signature-parsing error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This reverts commit b4559f4.
|
@lijun99 Could you rebase to the develop branch? That should resolve these test failures. |
|
It looks like Linux Latest Debug and (particularly) MacOS Latest Debug have large numbers of test failures outside of the ones that @bhawkins fixed |
resample_secondary_rslc_onto_reference() read the secondary RSLC via RSLC.getSlcDatasetAsNativeComplex(), which opens the file with h5py's default chunk cache instead of one sized for the dataset's own chunking. Open the secondary RSLC directly via HDF5OptimizedReader instead, matching the pattern already used in unwrap.py, crossmul.py, and other workflows. This cuts the resample step's SLC I/O read time by roughly 5x.
Replace the per-pixel Python loop (and its per-pixel calls into SubSwaths.get_sample_sub_swath) with vectorized numpy operations, reading offset raster rows only as needed to keep memory bounded. Tests show ~3.5x speedup on the prepare_insar_hdf5 step, and output verified bit-for-bit identical to the original.
0.1 is far tighter than the standard w-test threshold, causing excessive outlier-removal iterations without a corresponding accuracy benefit. 3.29 (alpha=0.001) is the conventional geodetic data-snooping critical value and matches ISCE2 precedent; validated against full-scene RUNW output with negligible impact on valid pixels.
b48c793 to
881a288
Compare
|
We're getting a weird mix of test failures here. Minimum Python Supported:
Linux Latest Release:
Linux Latest Debug:
macOS Latest Release:
macOS Latest Debug:
EDIT: These appear to be universal to recent PR's. I will open an issue about it. |
|
This pattern of errors is recorded now in #368. I don't see anything in the content of the errors that would be special to these changes, but the resample_slc and resample_slc_v2 Python workflows are effected in Linux Latest Debug so there's a small chance that an error in this PR for Linux Latest Debug would be hidden by those errors. @hfattahi how do you feel about proceeding with review with this in mind? I think such a hidden error is very improbable, so my position is that we can proceed. |
|
The CI error issue is fixed by #366 - please rebase when that PR merges and rebase again. |
|
Great, all test passed! Thank you, @bhawkins and @Tyler-g-hudson ! |
Tyler-g-hudson
left a comment
There was a problem hiding this comment.
With regards to the Resample update, this looks good!
|
@lijun99 thanks for this PR. I am ok with Resample and h5 prep changes but couple of us think that the polyfitting changes requires intense testing. To make progress faster, I suggest to decouple this PR to three separate PRs. Resample can be merged quickly. we will review h5 prep and we will need to discuss and test polyfitting further. |
|
I have spilt the PR into three separate parts.
Thanks! |
|
@lijun99 Thanks for the ping — and sorry for the overlap: I should have spotted #358 before filing #359 (I had been tracking this loop via #354 / #335 since Aug 13, but missed your PR when I filed mine two days after yours). Since the two Timing — synthetic reproducer from #354 (6840 x 10581 = 72.4 Mpx RIFG-like grid, three sub-swaths, no NISAR granules needed):
The output mask CRC is identical ( A minor contract-fidelity note on the #358 version. I also ran both implementations against a self-contained scalar oracle that calls Tests. #359 also carries a pytest suite (~350 lines, Happy to resolve the overlap either way: if you and the maintainers prefer the #358 implementation for the prepare part, I can rebase #359 down to a tests-only PR — the suite validates either implementation (modulo the fallback above). Otherwise #359 already carries implementation + tests. Whichever way, the cross-check script and logs are public in my benchmark repo ( |
|
For completeness: the real-data leg of the comparison above (NISAR frame; bitwise + peak-RSS results for both implementations) is now posted in #359 (comment) — keeping the data in one place since that is where the prepare-part decision lands. |
This PR aims to speed up three modules in insar workflows, prepare_insar_hdf5, resample_slc_v2, and rubbersheet. I put them together for easier testing. Please let me know if separate PRs are preferred.
prepare_insar_hdf5
Replace the per-pixel Python loop (and its per-pixel calls into SubSwaths.get_sample_sub_swath) with vectorized numpy operations, reading offset raster rows only as needed to keep memory bounded. Tests show ~3.5-10x speedup on the prepare_insar_hdf5 step, and output verified bit-for-bit identical to the original.
resample_slc_v2
Replace the legacy HDF5 reader with HDF5OptimizedReader used in unwrap.py, crossmul.py, and others. This cuts the resample step's SLC I/O read time by ~5-10x. Output is verified bit-for-bit identical to the original.
rubbersheet
Update rubbersheet polyfit critical_value from 0.1 to Baarda's convention 3.29.
0.1 (keeping only 8%) is far tighter than the standard w-test threshold, causing excessive outlier-removal iterations without a corresponding accuracy benefit. 3.29 (alpha=0.001) is the conventional geodetic data-snooping critical value. Recommended range 1.69-3.29.
Here is a test on a scene from Afar, Ethiopia,
It turns out that 0.1 removes 68.3% of good pixels for polyfit, not only makes the fitting less representative, but also leads to long iterations to finish.
In tests, choosing 3.29 leads to ~5-10x speedup for the polyfit. (Note that the rubbersheet procedure has heavy I/Os, the actual I/O performance depends on types of storage systems.) There is a small difference, ~0.2 rad across the scene, from a ramp, since the fitting parameters are slightly different.
BTW, I am also working on a gpu phase unwrapping. It shows some early success; but needs more test. Please give it a try when you have time.