feat: Rust code quality and website improvements for Apache Mahout (QDP & site)#1
Open
feat: Rust code quality and website improvements for Apache Mahout (QDP & site)#1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Closes #1080
Changes
Why
The QDP Rust core (qdp-core) currently has several broad unsafe blocks without safety documentation, lacks a CI pipeline to enforce rustdoc quality, and has multiple TODO placeholders across the documentation site.
How
dlpack.rs: Added module-level documentation (//!) and // SAFETY: explanations for all FFI pointer lifecycles and CUDA stream synchronizations.gpu/memory.rs: Narrowed unsafe scopes (e.g., query_cuda_mem_info , PinnedHostBuffer::new), added // SAFETY: comments for Send/Sync traits, and replaced eprintln! with standard log::warn! in the Drop implementation.gpu/pipeline.rs: Optimized high-frequency environment variable reads using std::sync::OnceLock and narrowed unsafe blocks for CUDA event creation/destruction.error.rs: Formatted MahoutError variants with RFC 505 compliant rustdoc.lib.rs&cuda_ffi.rs: Added comprehensive crate-level and module-level architecture documentation.CI/CD Pipeline:
.github/workflows/rustdoc.ymlto run cargo doc --no-deps with RUSTDOCFLAGS="-D warnings" on PRs, acting as a quality gate against documentation drift.
Website Documentation:
Replaced TODO placeholders in
docs/qumat/examples.mdwith 3 functional QuMat Python examples (Bell state, multiple backends, rotation gates).Replaced TODO placeholders in
docs/qumat/concepts.mdwith core QDP integration concepts.Created
docs/contributing/rust-docs.mdto establish project standards for RFC 505 formatting and // SAFETY: comment conventions.