Skip to content

fix(golang-github-task-slim-sprig): stabilize arm64 rounding - #18481

Open
Mitch Zhu (miz060) wants to merge 1 commit into
4.0from
mitchzhu/golang-github-task-slim-sprig-rounding
Open

fix(golang-github-task-slim-sprig): stabilize arm64 rounding#18481
Mitch Zhu (miz060) wants to merge 1 commit into
4.0from
mitchzhu/golang-github-task-slim-sprig-rounding

Conversation

@miz060

Copy link
Copy Markdown
Member

golang-github-task-slim-sprig fails TestRound on aarch64 with Go 1.26 because the compiler may fuse the multiplication passed to math.Modf, changing the observed fractional value. The Go specification permits this behavior, and a
Go maintainer recommends an explicit float64 conversion in golang/go#77657 to force rounding before Modf.

Apply that conversion to numeric.go during %prep, guarded by an exact source match. The original rounding test remains unchanged.

Validation:

  • Full builds and %check pass on x86_64 and aarch64.
  • The aarch64 validation used Azure Linux Go 1.26.5, matching the failing PME toolchain.
  • The resulting RPM installs cleanly, passes rpm -V, contains the converted source, and passes its installed-source test suite in an Azure Linux 4 mock chroot.

Copilot AI balanced review requested due to automatic review settings August 18, 2026 00:47
@miz060

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stabilizes arm64 rounding tests for golang-github-task-slim-sprig under Go 1.26.

Changes:

  • Forces float64 rounding before math.Modf.
  • Moves the component into a dedicated overlay configuration.
  • Refreshes the lock and rendered spec.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
base/comps/golang-github-task-slim-sprig/golang-github-task-slim-sprig.comp.toml Defines the source workaround overlay.
base/comps/components.toml Removes the former inline component entry.
locks/golang-github-task-slim-sprig.lock Refreshes the input fingerprint.
specs/g/golang-github-task-slim-sprig/golang-github-task-slim-sprig.spec Contains the rendered workaround and release bump.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread base/comps/golang-github-task-slim-sprig/golang-github-task-slim-sprig.comp.toml Outdated
Copilot AI review requested due to automatic review settings August 18, 2026 04:33
@miz060
Mitch Zhu (miz060) force-pushed the mitchzhu/golang-github-task-slim-sprig-rounding branch from 3f0aa35 to a3b628d Compare August 18, 2026 04:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

@miz060

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

@miz060

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

@miz060
Mitch Zhu (miz060) marked this pull request as ready for review August 18, 2026 18:47
@miz060
Mitch Zhu (miz060) requested a review from a team as a code owner August 18, 2026 18:47
description = "Force float64 rounding before math.Modf to prevent fused arithmetic from changing round results"
type = "spec-append-lines"
section = "%prep"
lines = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue(blocking): Are we changing the source code of the package? If so--and if we stick with this--can we please go with a regular .patch? That would also be something that could be more directly contributed upstream.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Fixed. I replaced the %prep source rewrite with a regular patch containing the same explicit float64 conversion.

@@ -0,0 +1,16 @@
[components.golang-github-task-slim-sprig]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question(blocking): Fedora upstream has orphaned this package entirely: https://src.fedoraproject.org/rpms/golang-github-task-slim-sprig

What in our distro is still requiring it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the Azure Linux 4 SDK dependency graph. Ginkgo v1 and v2 require slim-sprig. Ginkgo v1 is required by golevedb, which feeds httpcache -> k8s-client, so slim-sprig is not currently a removable leaf and needs to remain packaged. (I did find some other orphaned golang pkgs we should remove, will follow up in another PR).

Copilot AI review requested due to automatic review settings August 18, 2026 22:00
@miz060
Mitch Zhu (miz060) force-pushed the mitchzhu/golang-github-task-slim-sprig-rounding branch from a3b628d to a410bd3 Compare August 18, 2026 22:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

specs/g/golang-github-task-slim-sprig/golang-github-task-slim-sprig.spec:66

  • This generated output still contains a synthetic uncommitted entry and bumps the release to -12 above the actual -11 commit. AGENTS.md:39 requires re-rendering and amending after committing component changes; otherwise Check Rendered Specs will regenerate a different changelog. Commit the remaining component inputs, refresh/render, and amend so this entry is replaced by committed history.
* Tue Aug 18 2026 azldev <azldev@local> - 3.2.0-12
- Local changes (uncommitted)

Copilot AI review requested due to automatic review settings August 18, 2026 22:07
@miz060
Mitch Zhu (miz060) force-pushed the mitchzhu/golang-github-task-slim-sprig-rounding branch from a410bd3 to dd06a08 Compare August 18, 2026 22:07
@miz060

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Go 1.26 may fuse the multiplication passed to math.Modf on arm64, changing the fractional result and failing TestRound.

Force an explicit float64 rounding step before math.Modf, as recommended in golang/go#77657, while keeping the original test intact.

Signed-off-by: Mitch Zhu <mitchzhu@microsoft.com>
@miz060
Mitch Zhu (miz060) force-pushed the mitchzhu/golang-github-task-slim-sprig-rounding branch from dd06a08 to ffb40f9 Compare August 19, 2026 17:07
Copilot AI review requested due to automatic review settings August 19, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

base/comps/golang-github-task-slim-sprig/golang-github-task-slim-sprig.comp.toml:6

  • The metadata table below is attached only to the second overlays array element, so the source-changing patch-add has no provenance or upstream-status metadata. Add the issue metadata to this overlay as well (or move the pair to a per-file overlay with shared metadata).
source = "0001-numeric-force-float64-rounding-before-modf.patch"

@miz060

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants