Skip to content

[codex] add SDK guides#461

Merged
k82cn merged 2 commits into
xflops:mainfrom
k82cn:codex/sdk-docs
May 18, 2026
Merged

[codex] add SDK guides#461
k82cn merged 2 commits into
xflops:mainfrom
k82cn:codex/sdk-docs

Conversation

@k82cn
Copy link
Copy Markdown
Contributor

@k82cn k82cn commented May 18, 2026

Summary

  • Add central SDK documentation for Rust and Python under docs/sdk/.
  • Add a task-oriented Rust API tutorial based on the existing Rust Pi example.
  • Link the new docs from the README, API docs, Runner setup guide, and SDK-local READMEs.
  • Add a Rust SDK README and update the flame-rs package metadata to use it.
  • Align the Python SDK README requirement with package metadata by documenting Python >=3.9.

Validation

  • git diff --check
  • local Markdown link check for touched docs
  • cargo check -p flame-rs --all-targets --features macros
  • python3 -m compileall -q sdk/python/src/flamepy
  • cargo check -p pi --all-targets

fixes #47

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly expands the project's documentation by adding a general SDK overview, dedicated guides for the Python and Rust SDKs, and a comprehensive Rust API tutorial. It also updates various README files and existing tutorials with relevant links and corrects the Python version requirement. Feedback on the new Rust API tutorial points out a likely compilation error where try_join_all is used on task handles; the reviewer suggests using join_all instead because the underlying futures resolve to a result struct rather than a standard Result type.

Comment on lines +126 to +128
let handles =
try_join_all((0..cli.task_num).map(|_| ssn.run::<_, PiResponse>(&request))).await?;
let tasks = try_join_all(handles).await?;
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.

medium

The use of try_join_all on handles is likely incorrect here. According to the SDK documentation in docs/sdk/rust.md (line 93) and the description later in this tutorial (line 131), TaskFuture resolves to a TaskResult struct which contains metadata and error details, rather than a standard Rust Result.

try_join_all is designed for futures that return Result<T, E> and will fail fast if any future returns Err. If TaskFuture resolves to a struct, try_join_all will not compile. You should use join_all instead to wait for all tasks to complete and then inspect the TaskResult objects.

Additionally, ensure that join_all (and try_join_all if used for submission) are imported from the futures::future module.

Suggested change
let handles =
try_join_all((0..cli.task_num).map(|_| ssn.run::<_, PiResponse>(&request))).await?;
let tasks = try_join_all(handles).await?;
let handles =
try_join_all((0..cli.task_num).map(|_| ssn.run::<_, PiResponse>(&request))).await?;
let tasks = join_all(handles).await;

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@k82cn k82cn merged commit 5a916e4 into xflops:main May 18, 2026
6 checks passed
@k82cn k82cn deleted the codex/sdk-docs branch May 18, 2026 04:38
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.

Add document for Rust/Python SDK.

1 participant