Repository navigation
feat(combat): deterministic Q32.32 damage resolver #212
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
Merged
+9,799
−24
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5b01c1c
docs(combat): specify a deterministic Q32.32 damage resolver
cursoragent 30f1568
feat(combat): add the Q32.32 damage resolver
cursoragent 5803213
docs(combat): point the trace at the resolver commit
cursoragent 7cf0ba0
test(combat): lock properties, replay hash, and the timer walk
cursoragent f4be459
feat(combat): use core SimRng and join the replay gate
cursoragent 20b9306
docs(combat): point the trace at the SimRng rebase
cursoragent 7fb554f
fix(ci): expect 49 benchmark packages and log uncovered failures
cursoragent 358931b
refactor(combat): re-export astraweave-math Fixed64
cursoragent 36f7d74
docs(combat): point the trace at the math Fixed64 rebase
cursoragent a9881da
fix(ci): compare the full SDK version on Windows
cursoragent 0bc8af4
fix(ci): link the Windows SDK CMake example
cursoragent 9459573
feat(combat): send cover impulses through destruction and weaving
cursoragent 2bc203c
docs(combat): point the trace at the cover impulse commit
cursoragent d05820a
docs(destruction): mark the crate copy to drop when #243 lands
cursoragent 5bc0030
docs(combat): record the rebase onto main b7ffb358
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test(combat): lock properties, replay hash, and the timer walk
Property tests use proptest seed 0xC0BA7E57. A three-OS workflow compares the seeded battle digest. The timer walk reuses a scratch buffer. The benchmark shard map includes astraweave-combat, which was why every shard failed validation. Legacy damage paths stay. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
- Loading branch information
commit 7cf0ba024d5a02cc2677ba13a12093699c92b354
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Combat replay hash | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| hash: | ||
| name: Hash (${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@1.89.0 | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
|
|
||
| - name: Baseline CPU | ||
| run: | | ||
| host=$(rustc -vV | sed -n 's/host: //p') | ||
| case "$host" in | ||
| *x86_64*) echo 'RUSTFLAGS=-C target-cpu=x86-64' >> "$GITHUB_ENV" ;; | ||
| *) echo 'RUSTFLAGS=' >> "$GITHUB_ENV" ;; | ||
| esac | ||
|
|
||
| - name: Replay hash | ||
| run: cargo test -p astraweave-combat --test replay_hash -- --nocapture | ||
|
|
||
| - name: Upload | ||
| uses: actions/upload-artifact@v4 | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| with: | ||
| name: replay-hash-${{ runner.os }} | ||
| path: target/replay-hash.json | ||
| retention-days: 14 | ||
|
|
||
| compare: | ||
| name: Compare three OS | ||
| needs: hash | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download | ||
| uses: actions/download-artifact@v4 | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| with: | ||
| pattern: replay-hash-* | ||
| path: hashes | ||
|
|
||
| - name: Diff the digests | ||
| run: | | ||
| python3 - << 'PY' | ||
| import json, pathlib, sys | ||
| files = sorted(pathlib.Path("hashes").rglob("replay-hash.json")) | ||
| if len(files) != 3: | ||
| print(f"expected 3 replay files, found {len(files)}: {files}") | ||
| sys.exit(1) | ||
| parsed = [] | ||
| for path in files: | ||
| data = json.loads(path.read_text()) | ||
| case = next(row for row in data if row["case"] == "combat_resolve") | ||
| parsed.append((str(path), case["sha256"])) | ||
| print(f"{path}: {case['sha256']}") | ||
| digest = parsed[0][1] | ||
| bad = [row for row in parsed if row[1] != digest] | ||
| if bad: | ||
| print("combat_resolve digest differs across OS") | ||
| sys.exit(1) | ||
| print("combat_resolve matches on all three OS") | ||
| PY | ||
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.