Skip to content

Crate, Example, Documentation and Test Organisation #170

Closed
@XAMPPRocky

Description

@XAMPPRocky

The amount of crates, examples documentation, and tests are expanding pretty rapidly, and some of the layout is already is mildly confusing. I think we should figure out some sort of structure for each.

Crates

Currently we have three dev crates (five with #117) which are at the top level, the top level is already becoming pretty crowded with documentation, and configuration files. I think we should have a crates/ folder that houses the main development crates.

Documentation

Currently we have two directories (assets and rfcs) which are at the top level, but I think since these will be less frequently used I would propose that we should move assets into docs and move rfcs into docs/src and make it part of the rust GPU dev guide. This has the advantage of making the RFCs viewable in the rust gpu guide directly.

Tests

The integration tests for rustc_codegen_spirv are currently located inside spirv-builder in spirv-builder/src/test. This isn't where I would expect these kinds of tests to be. I propose that we create a new separate crate for holding integration/end-to-end tests (e.g. test_suite, codegen_test, etc).

Examples

We have four different example crates at the moment, all on the same level in examples, however it's not really clear which examples are related, or use each other. I would like to propose adding another level to examples that covers the basic domain of example (e.g. a wgpu directory for wgpu examples), and remove the example prefix from the name (e.g. example-runnerrunner).


I've included a tree output of what this proposed directory structure would look like if all of these changes implemented below.

.
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.lock
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── crates
│   ├── rustc_codegen_spirv
│   │   ├── Cargo.toml
│   │   └── src
│   ├── spirv-builder
│   │   ├── Cargo.toml
│   │   └── src
│   ├── spirv-std
│   │   ├── Cargo.toml
│   │   └── src
│   └── test-suite
│       ├── basic.rs
│       └── mod.rs
├── deny.toml
├── docs
│   ├── assets
│   │   └── sky.jpg
│   ├── book.toml
│   └── src
│       ├── SUMMARY.md
│       ├── attributes.md
│       ├── introduction.md
│       └── rfcs
├── examples
│   ├── basic
│   │   ├── cpu-runner
│   │   ├── runner
│   │   └── shader
│   └── wgpu
│       ├── runner
│       └── shader
├── rust-toolchain
├── setup.bat
└── setup.sh

20 directories, 21 files

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: metaIssues specific to the GitHub repository. README, CI, etc.t: enhancementA new feature or improvement to an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions