Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change system parameters from traits to structs #52

Merged
merged 28 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
54c6b2c
refactor: change system parameters from traits to structs
SOF3 Sep 30, 2023
f17d9b4
feat: add new accessor API ("zip")
SOF3 Oct 1, 2023
daed785
feat(system::access): add tuple impls for zip traits
SOF3 Oct 1, 2023
2dc6d84
fix(tests): fixed all unit tests + incorrect zip macro
SOF3 Oct 2, 2023
5cf9a84
fixed typo
SOF3 Oct 2, 2023
2dba51d
fix(codegen::system): rename discrim_key to discrim_set
SOF3 Oct 3, 2023
1d40f3d
refactor: split world::tests to separate files
SOF3 Oct 5, 2023
9e72f30
feat(accessor): derive traits for AccessSingle
SOF3 Oct 7, 2023
1d344fd
feat(accessor): also add traits for AccessIsotope
SOF3 Oct 7, 2023
e70586c
refactor: move world::tests to the corresponding modules
SOF3 Oct 7, 2023
0d50649
refactor: split test_util to separate modules
SOF3 Oct 8, 2023
9fb9588
fix(system::iter): do not add 1 padding for chunk serial access
SOF3 Oct 8, 2023
5858fbb
chore(ci): do not use compare action, just upload the benchmark repor…
SOF3 Oct 8, 2023
b7d0b3f
Merge branch 'master' into accessor-struct
SOF3 Oct 8, 2023
adecb6e
refactor: clean up benchmark code
SOF3 Oct 8, 2023
0eca06f
bench(iter_entity): add benches with holes
SOF3 Oct 8, 2023
20a86e6
fix(ealloc): flush the allocators on demand before executing schedule…
SOF3 Oct 14, 2023
a678976
chore(ci): do not push to last-benched-tag
SOF3 Oct 14, 2023
1cb1750
chore(bench): use full/hole as a bench subgroup
SOF3 Oct 14, 2023
c9a83c8
chore(bench): add benches for 4x-large holes
SOF3 Oct 14, 2023
76de889
chore: `E: entity:Raw` is a confusing name
SOF3 Oct 14, 2023
c91ac63
fix(book): rephrase and update chapters 1 to 3.1
SOF3 Oct 15, 2023
7c33878
fix(book): update documentation on entity iteration
SOF3 Oct 15, 2023
eff4ecc
feat(system): add EntityIterator::entities_with_chunked
SOF3 Oct 17, 2023
bad108e
chore(ci): run benchmarks on base branch first
SOF3 Oct 19, 2023
197bbcd
perf(bench): for_each has much better vectorization compares to a pla…
SOF3 Oct 20, 2023
ff287f3
feat(system::iter): add par_entities_with
SOF3 Oct 21, 2023
c4c08f2
fix(storage::vec): allow splitting storage beyond its bounds
SOF3 Oct 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ indent_size = 4

[*.md]
indent_style = space
indent_size = 4
indent_size = 2
30 changes: 25 additions & 5 deletions .github/workflows/bench-branch.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
on:
push:
branches-ignore:
- "dependabot/**"
branches:
- "master"
tags:
- "*"
pull_request:
name: benchmark
jobs:
runBenchmark:
name: run benchmark
runs-on: ubuntu-latest
if: "!startsWith(github.head_ref, 'dependabot/')"
steps:
- uses: actions/checkout@v3
- name: Check out base
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
ssh-key: ${{secrets.API_KEY}}
repo: ${{github.event.pull_request.base.repo.full_name}}
ref: ${{github.event.pull_request.base.ref}}
- name: Run benchmarks on base for comparison
if: github.event_name == 'pull_request'
run: cargo bench --features internal-bench

- name: Check out head
uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ssh-key: ${{secrets.API_KEY}}
repo: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.event.pull_request.head.ref}}
- name: Check out head
uses: actions/checkout@v3
if: github.event_name == 'push'
with:
ssh-key: ${{secrets.API_KEY}}

Expand Down Expand Up @@ -38,5 +60,3 @@ jobs:
- name: Push pages
run: git push --force
working-directory: ..site-repo
- run: git push origin HEAD:last-benched-tag
if: ${{github.ref_type}} == tag
27 changes: 22 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,29 @@ Naming type parameters follows the following conventions:
- If the type parameter has no specific bounds
and there are no more than two type parameters in scope,
the dummy names `T` and `U` MAY be used.
- If the type parameter is defined in the scope of a key-value store,
- If the type parameter is defined in the scope of a key-value collection,
i.e. the item at which the type parameters are defined
corresponds exclusively to exactly one key-value item,
the names `K` and `V` MAY be used for key and value types.
`K` or `V` SHOULD NOT be used alone without the other one.
the names `K` and `V` MAY be used for key and value types on the same collections.
`K` or `V` SHOULD NOT be used alone without the other one or on different collections.
- `F` and `I` MAY be used to represent closure and iterator types
only if there is no more than one generic function/iterator type in scope.
- Domain-specific acronyms: The following type parameters are ALLOWED only if
they describe the following dynec-specific concepts:
- `A`: Archetype
- `C`: Component (Simple or Isotope)
- `D`: Discriminant (for isotope components)
- `E`: Implements `entity::Ref` (NOT `entity::Raw`)
- Otherwise, the full name SHOULD be described in PascalCase directly
if it does not collide with the name of a type/trait that may be imported
if it does not collide with the name of a type/trait used in this project
(regardless whether it is *currently* imported).
- In the case of name collision, a `T` SHOULD be appended to its name.
- In the case of name collision, a `T` MAY be appended to its name.

#### Imports

- The `Result` type MUST NOT be aliased in the main crate.
However, importing `syn::Result` is RECOMMENDED in the codegen crate.
- Traits SHOULD be imported `as _`
if the imported trait identifier is not directly used
(if the module only uses the imported methods in the trait).
- Imports from the standard library MUST prefer `std` over `core`.
16 changes: 13 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,31 @@ itertools = "0.10.3"
log = "0.4.16"
parking_lot = {version = "0.12.0", features = ["owning_ref", "arc_lock", "send_guard"]}
rand = "0.8.5"
rayon = "1.5.2"
rayon = "1.8.0"
static_assertions = "1.1.0"
strum = {version = "0.24.0", optional = true}
xias = "0.3.0"
derive-trait = "0.0.4"

[features]
default = ["debug-entity-rc"]
debug-entity-rc = [] # Enable entity refcounting in debug mode.
release-entity-rc = [] # Enable entity refcounting in debug mode.
internal-bench = ["env_logger", "strum"] # Internal feature: enable benchmarking utils.
tuple-impl-32-zip = ["tuple-impl-24-zip"]
tuple-impl-24-zip = ["tuple-impl-16-zip"]
tuple-impl-16-zip = ["tuple-impl-8-zip"]
tuple-impl-8-zip = []
tuple-impl-32-init-fn = ["tuple-impl-24-init-fn"]
tuple-impl-24-init-fn = ["tuple-impl-16-init-fn"]
tuple-impl-16-init-fn = ["tuple-impl-8-init-fn"]
tuple-impl-8-init-fn = []
internal-bench = ["env_logger", "strum", "tuple-impl-8-zip"] # Internal feature: enable benchmarking utils.

[dev-dependencies]
criterion = { version = "0.4.0", features = ["html_reports"] }
env_logger = "0.10.0"
lazy_static = "1.4.0"
paste = "1.0.14"
strum = "0.24.0"

[lib]
Expand All @@ -56,4 +66,4 @@ name = "iter_entity_add"
harness = false

[profile.bench]
debug = true
lto = true
Loading
Loading