From c07933b74f4ae83a42d7eb69066e544aec069bb8 Mon Sep 17 00:00:00 2001 From: Ed J Date: Fri, 23 Feb 2024 21:15:20 +0000 Subject: [PATCH] fix dataflow when vaffine ndarray is between modified and downstream - #461 --- Basic/Core/pdlapi.c | 1 + Changes | 1 + t/slice.t | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Basic/Core/pdlapi.c b/Basic/Core/pdlapi.c index 2961d4406..2963fe16a 100644 --- a/Basic/Core/pdlapi.c +++ b/Basic/Core/pdlapi.c @@ -774,6 +774,7 @@ pdl_error pdl__make_physical_recprotect(pdl *it, int recurse_count) { PDL_RETERROR(PDL_err, pdl__make_physvaffine_recprotect(it, recurse_count+1)); if(PDL_VAFFOK(it)) { PDLDEBUG_f(printf("make_physical: VAFFOK\n")); + PDL_RETERROR(PDL_err, pdl__make_physical_recprotect(it->vafftrans->from, recurse_count+1)); PDL_RETERROR(PDL_err, pdl_readdata_vaffine(it)); PDLDEBUG_f(printf("make_physical turning off anychanged, before="); pdl_dump_flags_fixspace(it->state, 0, PDL_FLAGS_PDL)); it->state &= (~PDL_ANYCHANGED); diff --git a/Changes b/Changes index ac258cf41..4bf6ab0ae 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ - PP add loop(n=value) idiom to start not at 0 - add whichover, inspired by https://stackoverflow.com/questions/77551179/perl-pdl-indexing-and-which - random/randsym only produce real data +- fix dataflow when vaffine ndarray is between modified and downstream (#461) - thanks @vadim-160102 for continued reporting 2.085_01 2024-02-10 - test, document PDL::string, make more consistent (#459) - thanks @vadim-160102 for report diff --git a/t/slice.t b/t/slice.t index 8a040501b..19793be23 100644 --- a/t/slice.t +++ b/t/slice.t @@ -342,7 +342,8 @@ vafftest($all, [[0,1,0],[0,1,0],[0,1,0]], "clumped2 physvaff 1"); $root .= 3; vafftest($all, [[0,1,0],[1,1,0],[1,1,0]], "root assigned to"); $clumped2->make_physvaffine; -vafftest($all, [[0,1,0],[1,1,0],[0,1,0]], "clumped2 physvaff 2"); +vafftest($all, [[0,1,0],[0,1,0],[0,1,0]], "clumped2 physvaff 2"); +is "@{$clumped2->unpdl}", "3 3 3 3 3 3 3 3"; # Make sure that vaffining is properly working: my $y = xvals(5,6,2) + 0.1 * yvals(5,6,2) + 0.01 * zvals(5,6,2);