Skip to content

fix: clarify copy fast-path contracts#25

Merged
hayabusa-cloud merged 4 commits into
mainfrom
fix
May 4, 2026
Merged

fix: clarify copy fast-path contracts#25
hayabusa-cloud merged 4 commits into
mainfrom
fix

Conversation

@hayabusa-cloud

Copy link
Copy Markdown
Owner

Summary

This PR aligns the iox copy contract docs, fallback benchmarks, and validation timeouts with the implementation. It keeps invalid Writer counts as a caller-owned contract violation instead of adding repeated hot-loop validation branches.

Changes

  • Clarifies Copy and CopyPolicy fast-path boundaries: WriterTo and ReaderFrom implementations own source advancement, partial-write recovery, semantic error preservation, and progress accounting.
  • Replaces stack-buffer wording with implementation-accurate internal fixed-size buffer wording across GoDocs and READMEs.
  • Updates slow-path copy benchmarks so they bypass WriterTo and actually exercise the generic read/write loop.
  • Adds 120 second timeouts to CI and Makefile validation commands.

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 4, 2026 04:25
@codecov

codecov Bot commented May 4, 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
Contributor

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 updates iox’s Copy-family documentation and benchmarks to more precisely describe (and measure) behavior around the io.WriterTo / io.ReaderFrom fast paths, and adds explicit go test timeouts in local/CI automation.

Changes:

  • Clarifies fast-path contract boundaries in GoDocs and READMEs (fast path owns advancement, partial-write recovery, and semantic error preservation).
  • Fixes “slow-path” benchmarks to actually exercise the generic read/write loop (by using a Reader-only source).
  • Adds -timeout 120s to go test invocations in CI and Makefile targets.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
io.go Expands Copy/CopyPolicy docs to spell out fast-path ownership; updates buffer wording to “internal fixed-size buffer”.
doc.go Refines package-level semantics docs to make fast-path responsibilities explicit.
bench_test.go Adds a Reader-only benchmark source and switches slow-path benchmarks to avoid WriterTo fast path.
README.md Aligns English README fast-path and buffer wording with implementation/contract.
README.zh-CN.md Mirrors README fast-path/buffer clarifications in zh-CN translation.
README.ja.md Mirrors README fast-path/buffer clarifications in Japanese translation.
README.fr.md Mirrors README fast-path/buffer clarifications in French translation.
README.es.md Mirrors README fast-path/buffer clarifications in Spanish translation.
Makefile Adds -timeout 120s to go test targets (tests and benchmarks).
.github/workflows/ci.yml Adds -timeout 120s to CI test command and normalizes formatting.

Comment thread Makefile
Comment thread .github/workflows/ci.yml
Signed-off-by: Robin He <git@hybscloud.com>

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 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread bench_test.go
@hayabusa-cloud hayabusa-cloud merged commit db4ea68 into main May 4, 2026
9 checks passed
@hayabusa-cloud hayabusa-cloud deleted the fix branch May 4, 2026 04:51
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