Skip to content

Fix arm_tidy build: initialize out_of_range_value in applyHistogramQuantile - #107364

Merged
nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-armtidy-applyhistogramquantile-init-var
Jun 12, 2026
Merged

nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-armtidy-applyhistogramquantile-init-var

Conversation

@groeneai

@groeneai groeneai commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #103477

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

Build (arm_tidy) is failing on master since #103477 was merged (commit 2e8e7f1eac35730248415d79f9c60a7e68d0c223, 2026-06-12 18:23 UTC). cppcoreguidelines-init-variables (warnings-as-errors) rejects the uninitialized Float64 out_of_range_value in the new file src/Storages/TimeSeries/PrometheusQueryToSQL/applyHistogramQuantile.cpp:131:

applyHistogramQuantile.cpp:131:21: error: variable 'out_of_range_value' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
1 warning treated as error

arm_tidy is not a merge-queue gate, so the diagnostic was not blocking at merge time. All three branches below assign the variable, so it is logically safe, but the declaration must be initialized. Initialize it to quiet_NaN() at declaration (matches the isnan(phi) branch). No behavior change.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=2e8e7f1eac35730248415d79f9c60a7e68d0c223&name_0=MasterCI&name_1=Build%20%28arm_tidy%29

Version info

  • Merged into: 26.6.1.731

…antile

cppcoreguidelines-init-variables (warnings-as-errors) rejects the
uninitialized Float64 out_of_range_value introduced by ClickHouse#103477, breaking
the arm_tidy build on master. All three branches assign it, so it is
logically safe, but the declaration must be initialized. Initialize to
quiet_NaN() at declaration. No behavior change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

# Question Answer
a Deterministic repro? Yes. clang-tidy-21 -p build --checks='-*,cppcoreguidelines-init-variables' --warnings-as-errors='*' src/Storages/TimeSeries/PrometheusQueryToSQL/applyHistogramQuantile.cpp fails every time on the unmodified file with error: variable 'out_of_range_value' is not initialized at line 131:21, matching the arm_tidy CI log verbatim.
b Root cause explained? #103477 added a new file declaring Float64 out_of_range_value; with no initializer. The codebase enables cppcoreguidelines-init-variables with WarningsAsErrors: '*', so the uninitialized declaration is a fatal tidy error. arm_tidy is not a merge-queue gate, so it was not caught at merge time and now breaks master + every PR branched off the bad base.
c Fix matches root cause? Yes. Initializes the variable at its declaration (= std::numeric_limits<Float64>::quiet_NaN()), which is exactly what the lint requires. Not a band-aid: no tag suppression, no check disabling.
d Test intent preserved? / New tests? N/A. No test changes. The variable is unconditionally reassigned by all three branches below the declaration, so behavior is unchanged; quiet_NaN matches the isnan(phi) branch. A build-lint fix needs no functional test.
e Demonstrated in both directions? Yes. FAILS without the fix (init-variables error, exit 1). PASSES with the fix (init-variables error gone; only residual is an unrelated stale-build missing-include-dirs artifact that appears identically on the unchanged sibling applyFunction.cpp). Patched TU also compiles clean (applyHistogramQuantile.cpp.o, rc=0).
f Fix is general, not a narrow patch? Yes. Scanned all 3 files added by #103477; out_of_range_value is the only uninitialized scalar declaration. No sibling instances of the same pattern.

Session: cron:clickhouse-worker-slot-0:20260612-191700

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @vitlibar — could you review this one-line build hotfix? Build (arm_tidy) has been red on master since #103477 merged because cppcoreguidelines-init-variables (warnings-as-errors) rejects the uninitialized Float64 out_of_range_value in the new applyHistogramQuantile.cpp. All three branches reassign it, so this just initializes it to quiet_NaN() at declaration. No behavior change.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Jun 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [df35c31]


AI Review

Summary
  • This PR initializes out_of_range_value in applyHistogramQuantile to satisfy cppcoreguidelines-init-variables in Build (arm_tidy). The initializer matches the existing phi is NaN branch and every out-of-range branch still assigns the intended constant before use, so I do not see a behavior change or a correctness issue in the patch.
Final Verdict
  • Status: ✅ Approve

Merged via the queue into ClickHouse:master with commit 84d36b6 Jun 12, 2026
54 of 65 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants