Skip to content

docs: align atomix ordering contracts#13

Merged
hayabusa-cloud merged 6 commits into
mainfrom
docs/align-contacts
May 6, 2026
Merged

docs: align atomix ordering contracts#13
hayabusa-cloud merged 6 commits into
mainfrom
docs/align-contacts

Conversation

@hayabusa-cloud

Copy link
Copy Markdown
Owner

Summary

Align atomix documentation, repository validation, and test commentary with the implemented memory-ordering contract. The package behavior stays unchanged while public docs distinguish sync/atomic sequential consistency, atomix explicit ordering, pointer-based 128-bit Add return values, ARM64 intrinsic coverage, and weak-architecture 128-bit limitations.

Changes

Public contracts

  • Clarify that sync/atomic operations are sequentially consistent, while atomix defaults Load and Store to Relaxed and requires explicit Acquire/Release edges when synchronization is needed.
  • Document that wrapper Add/Sub/Inc/Dec and pointer-based 32/64/uintptr Add/Sub return new values, while pointer-based MemoryOrder.AddInt128 and MemoryOrder.AddUint128 return old values.
  • Sync READMEs, package GoDoc, and intrinsics documentation with the current ARM64 LSE, LL/SC, and 128-bit operation requirements.
  • Clarify compiler intrinsics coverage so 32/64-bit and pointer-sized AMD64/ARM64 operations are distinguished from 128-bit assembly stubs.

Weak-architecture 128-bit caveats

  • Document riscv64 and loong64 128-bit operations as low-word LR/SC or LL/SC emulation rather than true full-width 128-bit atomicity.
  • State that riscv64 and loong64 non-relaxed 128-bit Swap variants alias the relaxed swap path, so acquire/release publication requires a separate synchronization primitive or external synchronization.
  • Align wrapper, pointer API, internal architecture, and assembly comments with those caveats.

Tooling and tests

  • Set CI test and cross-build jobs to 5-minute job timeouts.
  • Set package tests to a 120s timeout in both CI and Makefile workflows, while keeping benchmarks on a longer timeout path.
  • Update test comments so return-value expectations describe atomix contracts directly.

Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Signed-off-by: Robin He <git@hybscloud.com>
Copilot AI review requested due to automatic review settings May 6, 2026 12:04
@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns Atomix’s public documentation and internal commentary with the currently implemented memory-ordering and return-value contracts, especially around default Relaxed Load/Store behavior, explicit Acquire/Release edges, and 128-bit limitations on weak architectures. It also updates CI and build tooling timeouts.

Changes:

  • Clarify ordering semantics vs sync/atomic, including default Relaxed Load/Store and explicit Acquire/Release synchronization edges.
  • Document return-value differences between wrapper APIs, pointer-based 32/64/uintptr APIs, and pointer-based 128-bit Add APIs.
  • Document weak-architecture (riscv64/loong64) 128-bit limitations, including non-relaxed Swap aliasing relaxed swap, and update CI/Makefile timeouts.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
uint128.go Adds notes about riscv64/loong64 128-bit Swap* orderings aliasing relaxed swap.
int128.go Mirrors 128-bit Swap* aliasing notes for signed wrapper.
order_uint128.go Documents MemoryOrder SwapUint128 aliasing on riscv64/loong64.
order_int128.go Documents MemoryOrder SwapInt128 aliasing on riscv64/loong64.
internal/arch/stubs_riscv64.go Updates riscv64 stub docs to reflect low-word LR/SC emulation and Swap128 aliasing.
internal/arch/stubs_loong64.go Updates loong64 stub docs to reflect low-word LL/SC emulation and Swap128 aliasing.
internal/arch/asm_riscv64.s Updates comments describing non-atomic full-width 128-bit emulation.
internal/arch/doc.go Updates internal arch package docs for ordering/fallback and 128-bit caveats.
internal/arch/arch_test.go Updates test comments to match Atomix-specific return-value contract language.
order_test.go Updates pointer-API Add test comment to Atomix contract phrasing.
atomix_test.go Updates wrapper Add/Sub test comments to Atomix contract phrasing.
coverage_test.go Updates wrapper Add/Sub test comments to Atomix contract phrasing.
doc.go Updates package GoDoc: ordering contract, return-value semantics, platform notes, and 128-bit caveats.
intrinsics.md Refines intrinsics documentation (supported coverage, return-value notes, ARM64 ordering limitations).
README.md Updates English README for ordering contract, return values, ARM64 baseline notes, and 128-bit caveats.
README.zh-CN.md Same as README.md for Chinese translation.
README.ja.md Same as README.md for Japanese translation.
README.fr.md Same as README.md for French translation.
README.es.md Same as README.md for Spanish translation.
Makefile Adds go test timeouts for test/bench targets.
.github/workflows/ci.yml Adds workflow permissions/concurrency, job timeouts, Go version patterns, and test timeout.
.github/instructions/copilot.instructions.md Updates contributor guidance to prefer code/docs truth and clarifies contracts/caveats.

Comment thread Makefile Outdated
Comment thread README.md
Comment thread README.zh-CN.md
Comment thread README.ja.md
Comment thread README.fr.md
Comment thread README.es.md
Comment thread internal/arch/doc.go Outdated
Comment thread internal/arch/doc.go Outdated
Signed-off-by: Robin He <git@hybscloud.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 22 out of 22 changed files in this pull request and generated no new comments.

@hayabusa-cloud hayabusa-cloud merged commit f1acade into main May 6, 2026
8 checks passed
@hayabusa-cloud hayabusa-cloud deleted the docs/align-contacts branch May 6, 2026 12:55
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.

2 participants