Skip to content

Commit

Permalink
Revert "Merge remote-tracking branch 'upstream/main' into fallible_sy…
Browse files Browse the repository at this point in the history
…stem_params"

This reverts commit 6c016af.
  • Loading branch information
JonahPlusPlus committed Jan 15, 2023
1 parent 6c016af commit ecf063a
Show file tree
Hide file tree
Showing 117 changed files with 2,268 additions and 3,620 deletions.
1 change: 0 additions & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ status = [
"build-without-default-features (bevy)",
"build-without-default-features (bevy_ecs)",
"build-without-default-features (bevy_reflect)",
"msrv",
]

use_squash_merge = true
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,29 +275,3 @@ jobs:
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Run cargo udeps
run: cargo udeps

msrv:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
- name: get MSRV
run: |
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
echo "MSRV=$msrv" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Run cargo check
run: cargo check
66 changes: 47 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Bevy is a completely free and open source game engine built in Rust. It currentl
Bevy also currently has the following "development process" goals:

* **Rapid experimentation over API stability**: We need the freedom to experiment and iterate in order to build the best engine we can. This will change over time as APIs prove their staying power.
* **Consistent vision**: The engine needs to feel consistent and cohesive. This takes precedent over democratic and/or decentralized processes. See our [*Bevy Organization doc*](/docs/the_bevy_organization.md) for more details.
* **Consistent vision**: The engine needs to feel consistent and cohesive. This takes precedent over democratic and/or decentralized processes. See [*How we're organized*](#how-were-organized) for more details.
* **Flexibility over bureaucracy**: Developers should feel productive and unencumbered by development processes.
* **Focus**: The Bevy Org should focus on building a small number of features excellently over merging every new community-contributed feature quickly. Sometimes this means pull requests will sit unmerged for a long time. This is the price of focus and we are willing to pay it. Fortunately Bevy is modular to its core. 3rd party plugins are a great way to work around this policy.
* **User-facing API ergonomics come first**: Solid user experience should receive significant focus and investment. It should rarely be compromised in the interest of internal implementation details.
Expand All @@ -66,19 +66,41 @@ Bevy also currently has the following "development process" goals:
* Most new features should have at least one minimal [example](https://github.com/bevyengine/bevy/tree/main/examples). These also serve as simple integration tests, as they are run as part of our CI process.
* The more complex or "core" a feature is, the more strict we are about unit tests. Use your best judgement here. We will let you know if your pull request needs more tests. We use [Rust's built in testing framework](https://doc.rust-lang.org/book/ch11-01-writing-tests.html).

## The Bevy Organization
## How we're organized

The Bevy Organization is the group of people responsible for stewarding the Bevy project. It handles things like merging pull requests, choosing project direction, managing bugs / issues / feature requests, running the Bevy website, controlling access to secrets, defining and enforcing best practices, etc.
@cart is, for now, our singular Benevolent Dictator and project lead.
He makes the final decision on both design and code changes within Bevy in order to ensure a coherent vision and consistent quality of code.

Note that you *do not* need to be a member of the Bevy Organization to contribute to Bevy. Community contributors (this means you) can freely open issues, submit pull requests, and review pull requests.
In practice, @cart serves as a shockingly accountable dictator: open to new ideas and to changing his mind in the face of compelling arguments or community consensus.
Check out the next section for details on how this plays out.

Check out our dedicated [Bevy Organization document](/docs/the_bevy_organization.md) to learn more about how we're organized.
[Bevy Org members](https://github.com/orgs/bevyengine/people) are contributors who:

1. Have actively engaged with Bevy development.
2. Have demonstrated themselves to be polite and welcoming representatives of the project with an understanding of our goals and direction.
3. Have asked to join the Bevy Org. Reach out to @cart on [Discord] or email us at bevyengine@gmail.com if you are interested. Everyone is welcome to do this. We generally accept membership requests, so don't hesitate if you are interested!

All Bevy Org members are also Triage Team members. These people can label and close issues and PRs but do not have merge rights or any special authority within the community.

Merge rights within the org are relatively centralized: this requires a large amount of trust when it comes to ethics, technical ability, and ability to enforce consistent project direction.

The current structure is as follows:

* @cart is our project lead, and has final say on controversial decisions
* There is a small group of other maintainers (@alice-i-cecile, @mockersf and @superdump), who have merge rights but abide by the following rules:
* Trivial PRs can be merged without approvals.
* Relatively uncontroversial PRs can be merged following approval from at least two other community members with appropriate expertise.
* Controversial PRs are added to a backlog for @cart to address once two maintainers agree that they are ready.
* If 45 days elapse without action on a controversial PR (approval, feedback or an explicit request to defer), they can be merged without project lead approval.
* The Bevy org is made up of trusted community contributors: this is a relatively low bar, and org members help triage and maintain the project.
* Community contributors (this means you!) can freely open issues, submit PRs and review PRs to improve Bevy.
* As discussed above, community reviews on PRs are incredibly helpful to enable maintainers to merge in uncontroversial PRs in a timely fashion.

### Classifying PRs

Our merge strategy relies on the classification of PRs into three categories: **trivial**, **uncontroversial** and **controversial**.
This strategy relies on a classification of PRs into three categories: **trivial**, **uncontroversial** and **controversial**.
When making PRs, try to split out more controversial changes from less controversial ones, in order to make your work easier to review and merge.
PRs that are deemed controversial will receive the [`S-Controversial`](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Controversial) label, and will have to go through the more thorough review process.
PRs that are deemed controversial will receive the `S-Controversial` label, and will have to go through the more thorough review process.

PRs are trivial if there is no reasonable argument against them. This might include:

Expand All @@ -103,27 +125,24 @@ PRs are controversial if there is serious design discussion required, or a large
Finally, changes are "relatively uncontroversial" if they are neither trivial or controversial.
Most PRs should fall into this category.

Here are some useful pull request queries:

* [Uncontroversial pull requests which have been reviewed and are ready for maintainers to merge](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+-label%3AS-Controversial+-label%3AS-Blocked+-label%3AS-Adopt-Me+)
* [Controversial pull requests which have been reviewed and are ready for final input from a Project Lead or SME](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+label%3AS-Controversial+)

### Preparing Releases
## How we work together

Making a game engine is a huge project and facilitating collaboration is a lot of work.
At the moment @cart is our only paid contributor, so [go sponsor him!](https://github.com/sponsors/cart)
We track issues and pull requests that must be included in releases using [Milestones](https://github.com/bevyengine/bevy/milestones).

## Making changes to Bevy
### Making changes to Bevy

Most changes don't require much "process". If your change is relatively straightforward, just do the following:

1. A community member (that's you!) creates one of the following:
* [GitHub Discussions]: An informal discussion with the community. This is the place to start if you want to propose a feature or specific implementation.
* [Issue](https://github.com/bevyengine/bevy/issues): A formal way for us to track a bug or feature. Please look for duplicates before opening a new issue and consider starting with a Discussion.
* [Pull Request](https://github.com/bevyengine/bevy/pulls) (or PR for short): A request to merge code changes. This starts our "review process". You are welcome to start with a pull request, but consider starting with an Issue or Discussion for larger changes (or if you aren't certain about a design). We don't want anyone to waste their time on code that didn't have a chance to be merged! But conversely, sometimes PRs are the most efficient way to propose a change. Just use your own judgement here.
2. Other community members review and comment in an ad-hoc fashion. Active subject matter experts may be pulled into a thread using `@mentions`. If your PR has been quiet for a while and is ready for review, feel free to leave a message to "bump" the thread, or bring it up on [Discord](https://discord.gg/bevy) in an appropriate engine development channel.
2. Other community members review and comment in an ad-hoc fashion. Active subject matter experts may be pulled into a thread using `@mentions`. If your PR has been quiet for a while and is ready for review, feel free to leave a message to "bump" the thread, or bring it up on [Discord] in an appropriate engine development channel.
3. Once they're content with the pull request (design, code quality, documentation, tests), individual reviewers leave "Approved" reviews.
4. After consensus has been reached (typically two approvals from the community or one for extremely simple changes) and CI passes, the [S-Ready-For-Final-Review](https://github.com/bevyengine/bevy/issues?q=is%3Aopen+is%3Aissue+label%3AS-Ready-For-Final-Review) label is added.
5. When they find time, someone with merge rights performs a final code review and merges the PR using [Bors](https://bors.tech/) by typing `bors r+`.
5. When they find time, [someone with merge rights](#how-were-organized) performs a final code review and merges the PR using [Bors](https://bors.tech/) by typing `bors r+`.

### Complex changes

Expand Down Expand Up @@ -161,7 +180,7 @@ If you release a game on [itch.io](https://itch.io/games/tag-bevy) we'd be thril

### Teaching others

Bevy is still very young, and light on documentation, tutorials, and accumulated expertise.
Bevy is still very young, and light on documentation, tutorials and accumulated expertise.
By helping others with their issues, and teaching them about Bevy, you will naturally learn the engine and codebase in greater depth while also making our community better!

Some of the best ways to do this are:
Expand Down Expand Up @@ -254,7 +273,7 @@ Not even our project lead is exempt from reviews and RFCs!
By giving feedback on this work (and related supporting work), you can help us make sure our releases are both high-quality and timely.

Finally, if nothing brings you more satisfaction than seeing every last issue labeled and all resolved issues closed, feel free to message @cart for a Bevy org role to help us keep things tidy.
As discussed in our [*Bevy Organization doc*](/docs/the_bevy_organization.md), this role only requires good faith and a basic understanding of our development process.
As discussed in [*How we're organized*](#how-were-organized), this role only requires good faith and a basic understanding of our development process.

### How to adopt pull requests

Expand All @@ -276,6 +295,15 @@ Then notify org members to close the original.

`Adopted #number-original-pull-request`

### Maintaining code

Maintainers can merge uncontroversial pull requests that have at least two approvals (or at least one for trivial changes).

These search filters show the requests that can be merged by maintainers, and those which need a final approval from @cart.

1. Pulls requests which are ready for maintainers to merge without consultation: [requests to pull](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+-label%3AS-Controversial+-label%3AS-Blocked+-label%3AS-Adopt-Me+)
2. Pull requests which need final input from @cart: [requests to verify](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+label%3AS-Controversial+)

### Contributing code

Bevy is actively open to code contributions from community members.
Expand Down Expand Up @@ -308,7 +336,7 @@ If you end up adding a new official Bevy crate to the `bevy` repo:

When contributing, please:

* Try to loosely follow the workflow in [*Making changes to Bevy*](#making-changes-to-bevy).
* Try to loosely follow the workflow in [*How we work together*](#how-we-work-together).
* Consult the [style guide](.github/contributing/engine_style_guide.md) to help keep our code base tidy.
* Explain what you're doing and why.
* Document new code with doc comments.
Expand Down
19 changes: 11 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/bevyengine/bevy"
rust-version = "1.66.0"

[workspace]
exclude = ["benches", "crates/bevy_ecs_compile_fail_tests", "crates/bevy_reflect_compile_fail_tests"]
Expand Down Expand Up @@ -90,13 +89,6 @@ flac = ["bevy_internal/flac"]
mp3 = ["bevy_internal/mp3"]
vorbis = ["bevy_internal/vorbis"]
wav = ["bevy_internal/wav"]
symphonia-aac = ["bevy_internal/symphonia-aac"]
symphonia-all = ["bevy_internal/symphonia-all"]
symphonia-flac = ["bevy_internal/symphonia-flac"]
symphonia-isomp4 = ["bevy_internal/symphonia-isomp4"]
symphonia-mp3 = ["bevy_internal/symphonia-mp3"]
symphonia-vorbis = ["bevy_internal/symphonia-vorbis"]
symphonia-wav = ["bevy_internal/symphonia-wav"]

# Enable watching file system for asset hot reload
filesystem_watcher = ["bevy_internal/filesystem_watcher"]
Expand Down Expand Up @@ -1384,6 +1376,17 @@ description = "Shows a visualization of gamepad buttons, sticks, and triggers"
category = "Tools"
wasm = false

# Transforms
[[example]]
name = "global_vs_local_translation"
path = "examples/transforms/global_vs_local_translation.rs"

[package.metadata.example.global_vs_local_translation]
name = "Global / Local Translation"
description = "Illustrates the difference between direction of a translation in respect to local object or global object Transform"
category = "Transforms"
wasm = true

[[example]]
name = "3d_rotation"
path = "examples/transforms/3d_rotation.rs"
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/bevy_ecs/components/archetype_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn added_archetypes(criterion: &mut Criterion) {
stage.run(&mut world);
},
criterion::BatchSize::LargeInput,
);
)
},
);
}
Expand Down
8 changes: 4 additions & 4 deletions benches/benches/bevy_ecs/scheduling/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ pub fn build_schedule(criterion: &mut Criterion) {
// Not particularly realistic but this can be refined later.
for i in 0..graph_size {
let mut sys = empty_system.label(labels[i]).before(DummyLabel);
for label in labels.iter().take(i) {
sys = sys.after(*label);
for a in 0..i {
sys = sys.after(labels[a]);
}
for label in &labels[i + 1..graph_size] {
sys = sys.before(*label);
for b in i + 1..graph_size {
sys = sys.before(labels[b]);
}
app.add_system(sys);
}
Expand Down
6 changes: 3 additions & 3 deletions benches/benches/bevy_ecs/scheduling/stages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn empty_systems(criterion: &mut Criterion) {
});
});
}
group.finish();
group.finish()
}

pub fn busy_systems(criterion: &mut Criterion) {
Expand Down Expand Up @@ -107,7 +107,7 @@ pub fn busy_systems(criterion: &mut Criterion) {
);
}
}
group.finish();
group.finish()
}

pub fn contrived(criterion: &mut Criterion) {
Expand Down Expand Up @@ -158,5 +158,5 @@ pub fn contrived(criterion: &mut Criterion) {
);
}
}
group.finish();
group.finish()
}
9 changes: 7 additions & 2 deletions benches/benches/bevy_ecs/world/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub fn spawn_commands(criterion: &mut Criterion) {
entity.despawn();
}
}
drop(commands);
command_queue.apply(&mut world);
});
});
Expand All @@ -81,7 +82,7 @@ pub fn insert_commands(criterion: &mut Criterion) {
group.measurement_time(std::time::Duration::from_secs(4));

let entity_count = 10_000;
group.bench_function("insert", |bencher| {
group.bench_function(format!("insert"), |bencher| {
let mut world = World::default();
let mut command_queue = CommandQueue::default();
let mut entities = Vec::new();
Expand All @@ -96,10 +97,11 @@ pub fn insert_commands(criterion: &mut Criterion) {
.entity(*entity)
.insert((Matrix::default(), Vec3::default()));
}
drop(commands);
command_queue.apply(&mut world);
});
});
group.bench_function("insert_batch", |bencher| {
group.bench_function(format!("insert_batch"), |bencher| {
let mut world = World::default();
let mut command_queue = CommandQueue::default();
let mut entities = Vec::new();
Expand All @@ -114,6 +116,7 @@ pub fn insert_commands(criterion: &mut Criterion) {
values.push((*entity, (Matrix::default(), Vec3::default())));
}
commands.insert_or_spawn_batch(values);
drop(commands);
command_queue.apply(&mut world);
});
});
Expand Down Expand Up @@ -157,6 +160,7 @@ pub fn fake_commands(criterion: &mut Criterion) {
commands.add(FakeCommandB(0));
}
}
drop(commands);
command_queue.apply(&mut world);
});
});
Expand Down Expand Up @@ -199,6 +203,7 @@ pub fn sized_commands_impl<T: Default + Command>(criterion: &mut Criterion) {
for _ in 0..command_count {
commands.add(T::default());
}
drop(commands);
command_queue.apply(&mut world);
});
});
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/bevy_ecs/world/world_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ pub fn query_get_component_simple(criterion: &mut Criterion) {

bencher.iter(|| {
for _x in 0..100000 {
let mut a = unsafe { query.get_unchecked(&world, entity).unwrap() };
let mut a = unsafe { query.get_unchecked(&mut world, entity).unwrap() };
a.0 += 1.0;
}
});
Expand Down
4 changes: 2 additions & 2 deletions benches/benches/bevy_reflect/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn list_apply<M, LBase, LPatch, F1, F2, F3>(
let f_base = f_base(size);
let patch = f_patch(size);
bencher.iter_batched(
f_base,
|| f_base(),
|mut base| base.apply(black_box(&patch)),
BatchSize::SmallInput,
);
Expand All @@ -58,7 +58,7 @@ fn concrete_list_apply(criterion: &mut Criterion) {
group.warm_up_time(WARM_UP_TIME);
group.measurement_time(MEASUREMENT_TIME);

let empty_base = |_: usize| Vec::<u64>::new;
let empty_base = |_: usize| || Vec::<u64>::new();
let full_base = |size: usize| move || iter::repeat(0).take(size).collect::<Vec<u64>>();
let patch = |size: usize| iter::repeat(1).take(size).collect::<Vec<u64>>();

Expand Down
Loading

0 comments on commit ecf063a

Please sign in to comment.