From e1625e5e6d9eab0294c518e776e54baa5be19b15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:20:51 +0000 Subject: [PATCH 1/7] Initial plan From 63e71d560cc8c5bb99dd62cd903310c048cf2c8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:27:23 +0000 Subject: [PATCH 2/7] Apply shuffle filter only when compression is actually enabled Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- expui/BiorthBasis.cc | 11 +++++++---- exputil/EmpCylSL.cc | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index e81f67ffe..f2051e151 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -5169,7 +5169,8 @@ namespace BasisClasses if (H5compress) { unsigned int csz = sampleCounts.size(); dcpl1.add(HighFive::Chunking({csz, 1})); - if (H5shuffle) dcpl1.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is actually enabled + if (H5shuffle && H5compress > 0) dcpl1.add(HighFive::Shuffle()); dcpl1.add(HighFive::Deflate(H5compress)); } @@ -5207,7 +5208,7 @@ namespace BasisClasses stanza.createAttribute ("fullCovar", HighFive::DataSpace::From(icov)).write(icov); - if (H5compress) { + if (H5compress || H5szip) { // Szip parameters const int options_mask = H5_SZIP_NN_OPTION_MASK; const int pixels_per_block = 8; @@ -5218,7 +5219,8 @@ namespace BasisClasses HighFive::Chunking data_dims2{std::min(csz2, H5chunk), 1}; dcpl2.add(data_dims2); - if (H5shuffle) dcpl2.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is actually enabled + if (H5shuffle && (H5compress > 0 || H5szip)) dcpl2.add(HighFive::Shuffle()); if (H5szip) { dcpl2.add(HighFive::Szip(options_mask, pixels_per_block)); } else { @@ -5231,7 +5233,8 @@ namespace BasisClasses HighFive::Chunking data_dims3{std::min(csz3, H5chunk), 1}; dcpl3.add(data_dims3); - if (H5shuffle) dcpl3.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is actually enabled + if (H5shuffle && (H5compress > 0 || H5szip)) dcpl3.add(HighFive::Shuffle()); if (H5szip) { dcpl3.add(HighFive::Szip(options_mask, pixels_per_block)); } else { diff --git a/exputil/EmpCylSL.cc b/exputil/EmpCylSL.cc index 63829ea63..c6e426757 100644 --- a/exputil/EmpCylSL.cc +++ b/exputil/EmpCylSL.cc @@ -7381,11 +7381,12 @@ void EmpCylSL::WriteH5Cache() // auto dcpl = HighFive::DataSetCreateProps{}; - if (H5compress) { + if (H5compress || H5szip) { // Chunking unsigned long nx = NUMX + 1, ny = NUMY + 1; dcpl.add(HighFive::Chunking({nx, ny})); - if (H5shuffle) dcpl.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is actually enabled + if (H5shuffle && (H5compress > 0 || H5szip)) dcpl.add(HighFive::Shuffle()); if (H5szip) { const int options_mask = H5_SZIP_NN_OPTION_MASK; const int pixels_per_block = 8; From 447734e8aeff9fe457f0a82b2308dfc057bf586e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:29:17 +0000 Subject: [PATCH 3/7] Add explicit compression check for shuffle filter in sample stats section Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- expui/BiorthBasis.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index f2051e151..57ebf5b75 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -5166,10 +5166,12 @@ namespace BasisClasses auto dcpl3 = HighFive::DataSetCreateProps{}; // covariance // Properties for sample stats + // Note: Sample stats only use Deflate compression, not Szip if (H5compress) { unsigned int csz = sampleCounts.size(); dcpl1.add(HighFive::Chunking({csz, 1})); // Only apply shuffle filter when compression is actually enabled + // H5compress > 0 check is explicit for clarity (redundant with outer if) if (H5shuffle && H5compress > 0) dcpl1.add(HighFive::Shuffle()); dcpl1.add(HighFive::Deflate(H5compress)); } From 1afbfdc3276e5c4d6f41cefe136e0a888ae71154 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:31:34 +0000 Subject: [PATCH 4/7] Use explicit H5compress > 0 checks for consistency and clarity Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- expui/BiorthBasis.cc | 7 +++---- exputil/EmpCylSL.cc | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index 57ebf5b75..073fc4215 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -5167,12 +5167,11 @@ namespace BasisClasses // Properties for sample stats // Note: Sample stats only use Deflate compression, not Szip - if (H5compress) { + if (H5compress > 0) { unsigned int csz = sampleCounts.size(); dcpl1.add(HighFive::Chunking({csz, 1})); // Only apply shuffle filter when compression is actually enabled - // H5compress > 0 check is explicit for clarity (redundant with outer if) - if (H5shuffle && H5compress > 0) dcpl1.add(HighFive::Shuffle()); + if (H5shuffle) dcpl1.add(HighFive::Shuffle()); dcpl1.add(HighFive::Deflate(H5compress)); } @@ -5210,7 +5209,7 @@ namespace BasisClasses stanza.createAttribute ("fullCovar", HighFive::DataSpace::From(icov)).write(icov); - if (H5compress || H5szip) { + if (H5compress > 0 || H5szip) { // Szip parameters const int options_mask = H5_SZIP_NN_OPTION_MASK; const int pixels_per_block = 8; diff --git a/exputil/EmpCylSL.cc b/exputil/EmpCylSL.cc index c6e426757..c46066a5f 100644 --- a/exputil/EmpCylSL.cc +++ b/exputil/EmpCylSL.cc @@ -7381,7 +7381,7 @@ void EmpCylSL::WriteH5Cache() // auto dcpl = HighFive::DataSetCreateProps{}; - if (H5compress || H5szip) { + if (H5compress > 0 || H5szip) { // Chunking unsigned long nx = NUMX + 1, ny = NUMY + 1; dcpl.add(HighFive::Chunking({nx, ny})); From a02348ff541cc3394d34b6a393effb8cd41d23ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:33:21 +0000 Subject: [PATCH 5/7] Simplify shuffle filter conditions and improve consistency Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- expui/BiorthBasis.cc | 10 +++++----- exputil/EmpCylSL.cc | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index 073fc4215..d38d7564d 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -5170,7 +5170,7 @@ namespace BasisClasses if (H5compress > 0) { unsigned int csz = sampleCounts.size(); dcpl1.add(HighFive::Chunking({csz, 1})); - // Only apply shuffle filter when compression is actually enabled + // Only apply shuffle filter when compression is enabled (guaranteed by outer if) if (H5shuffle) dcpl1.add(HighFive::Shuffle()); dcpl1.add(HighFive::Deflate(H5compress)); } @@ -5220,8 +5220,8 @@ namespace BasisClasses HighFive::Chunking data_dims2{std::min(csz2, H5chunk), 1}; dcpl2.add(data_dims2); - // Only apply shuffle filter when compression is actually enabled - if (H5shuffle && (H5compress > 0 || H5szip)) dcpl2.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is enabled (guaranteed by outer if) + if (H5shuffle) dcpl2.add(HighFive::Shuffle()); if (H5szip) { dcpl2.add(HighFive::Szip(options_mask, pixels_per_block)); } else { @@ -5234,8 +5234,8 @@ namespace BasisClasses HighFive::Chunking data_dims3{std::min(csz3, H5chunk), 1}; dcpl3.add(data_dims3); - // Only apply shuffle filter when compression is actually enabled - if (H5shuffle && (H5compress > 0 || H5szip)) dcpl3.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is enabled (guaranteed by outer if) + if (H5shuffle) dcpl3.add(HighFive::Shuffle()); if (H5szip) { dcpl3.add(HighFive::Szip(options_mask, pixels_per_block)); } else { diff --git a/exputil/EmpCylSL.cc b/exputil/EmpCylSL.cc index c46066a5f..43a856018 100644 --- a/exputil/EmpCylSL.cc +++ b/exputil/EmpCylSL.cc @@ -7385,8 +7385,8 @@ void EmpCylSL::WriteH5Cache() // Chunking unsigned long nx = NUMX + 1, ny = NUMY + 1; dcpl.add(HighFive::Chunking({nx, ny})); - // Only apply shuffle filter when compression is actually enabled - if (H5shuffle && (H5compress > 0 || H5szip)) dcpl.add(HighFive::Shuffle()); + // Only apply shuffle filter when compression is enabled (guaranteed by outer if) + if (H5shuffle) dcpl.add(HighFive::Shuffle()); if (H5szip) { const int options_mask = H5_SZIP_NN_OPTION_MASK; const int pixels_per_block = 8; From 6b7271ee6649de3da4e24f77954e5855ff961a72 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:34:19 +0000 Subject: [PATCH 6/7] Clarify comment for Deflate-only compression section Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- expui/BiorthBasis.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expui/BiorthBasis.cc b/expui/BiorthBasis.cc index d38d7564d..e80f1fc57 100644 --- a/expui/BiorthBasis.cc +++ b/expui/BiorthBasis.cc @@ -5170,7 +5170,7 @@ namespace BasisClasses if (H5compress > 0) { unsigned int csz = sampleCounts.size(); dcpl1.add(HighFive::Chunking({csz, 1})); - // Only apply shuffle filter when compression is enabled (guaranteed by outer if) + // Only apply shuffle filter when Deflate compression is enabled (guaranteed by outer if) if (H5shuffle) dcpl1.add(HighFive::Shuffle()); dcpl1.add(HighFive::Deflate(H5compress)); } From ae5b00fd2611849e4f241c303a31438b0df15dc2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:35:26 +0000 Subject: [PATCH 7/7] Final update to PR description with complete summary Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- _codeql_detected_source_root | 1 + 1 file changed, 1 insertion(+) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 000000000..945c9b46d --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file