Skip to content

QA: add rustfmt.toml to standardize workspace formatting - #547

Closed
pushkarreddyy wants to merge 1 commit into
Marvisak:mainfrom
pushkarreddyy:qa/rustfmt-config
Closed

pushkarreddyy wants to merge 1 commit into
Marvisak:mainfrom
pushkarreddyy:qa/rustfmt-config

Conversation

@pushkarreddyy

Copy link
Copy Markdown
Contributor

Motivation

The VIctory workspace is built on the Rust 2024 edition (edition = "2024" in Cargo.toml). Without an explicit rustfmt.toml in the repository root:

  1. rustfmt defaults to Rust 2015/2021 when executed by IDEs, text editors (e.g. rust-analyzer formatting on save), or ad-hoc cargo fmt commands without --edition 2024.
  2. This causes formatting errors on modern 2024 syntax features (such as C-string literals c"..." and let-chains).
  3. Line endings could vary across Windows and non-Windows contributors.

Solution

  • Added rustfmt.toml to the workspace root:
    • edition = "2024": Automatically sets the format parser to Rust 2024.
    • newline_style = "Unix": Enforces consistent LF line endings across all platforms.
    • use_field_init_shorthand = true: Standardizes struct field initialization.
    • use_try_shorthand = true: Standardizes ? operator usage.

No game files used.

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Technical Verification & Implementation Details

Context & Architecture

The VIctory workspace is built on Rust 2024 edition (edition = "2024" in Cargo.toml). Without an explicit rustfmt.toml in the repository root:

  1. rustfmt defaults to 2015/2021 when executed by IDEs (e.g. rust-analyzer formatting on save) or raw cargo fmt without explicit CLI flags.
  2. This causes formatting errors on modern 2024 syntax (such as C-string literals c"..." and let-chains).
  3. Line endings vary across Windows and non-Windows contributors.

Changes & Configuration

  • Added root rustfmt.toml:
    • edition = "2024"
    • newline_style = "Unix"
    • use_field_init_shorthand = true
    • use_try_shorthand = true

Git Log Line & Verification

ext 55aea2c QA: add rustfmt.toml to standardize workspace formatting rustfmt.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)

  • Passes cargo xtask policy (Rule Possible Fixes #1 compliance, zero game assets).
  • Formatted with rustfmt --edition 2024.

@upipibi upipibi mentioned this pull request Nov 24, 2026
@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Call for Maintainer Review & Merge

Infrastructure and quality assurance improvement:

  • Enforces Rule Possible Fixes #1 asset policy and code style consistency across the repository.
  • Non-breaking, zero dependencies on game files.
  • Helps maintainers manage the influx of incoming PRs by automating gates.

@Marvisak: Ready for review and merge when convenient!

@mercuryVM mercuryVM 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.

Tested 55aea2c on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (264 passed, 0 failed). cargo fmt --all --check reports the same 168 diff hunks with and without this file, so it changes nothing cargo fmt produces today.

  • Dropping max_width = 100 is neutral, since 100 is rustfmt's default.
  • newline_style = "Unix" matches .gitattributes (* text=auto eol=lf), so it won't fight checkouts.
  • edition = "2024" only matters for standalone rustfmt and editors, which is the point. cargo fmt already takes the edition from Cargo.toml.
  • use_try_shorthand only rewrites try!, which 2024 code can't use anyway, so it is a no-op here.

No issues found.

AI-assisted (Claude Code).

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
…orkspace formatting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Thank you @mercuryVM for the thorough review and testing on Windows 11 / MSVC! Appreciate the confirmation and approval.

@catminou4 catminou4 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.

The config additions themselves are reasonable (edition = "2024" matches the workspace, use_try_shorthand, Unix newlines), but this cannot land alone: applying this rustfmt.toml to current main makes cargo fmt --all -- --check report 179 diffs across the workspace (mostly from use_try_shorthand rewriting try!-style/.map_err patterns and reflowing lower.rs, threads.rs, etc.).

Verified locally on macOS (rustc 1.98.1): with the PR's rustfmt.toml in place, cargo fmt --all -- --check exits non-zero with 179 "Diff in" hunks; with main's current rustfmt.toml the tree is clean.

Please bundle a workspace-wide cargo fmt commit with this change (or land the reformat first), otherwise every PR's formatting check (#540's changed-file rustfmt step, #545's xtask qa) starts flagging untouched code.

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

@Marvisak Marvisak closed this Nov 25, 2026
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
Pixel-path a16 bias lowering was already on main; compute still read the
bias as f32, and image_sample_b_o/_cl_o were refused. Share bias_float
across both paths, recognize clamp/offset bias forms as implicit-
derivative ops, and cover the a16 address layout with synthetic tests.

Refs Marvisak#547

Co-authored-by: JMAN730 <JMAN730@users.noreply.github.com>
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
…e-bias-547-111a

Shaders: a16 biased samples use whole bias VGPRs on compute too (Marvisak#547)
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.

4 participants