Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
# `rustc scripts/cpuprobe.rs` drops its binary wherever it is run from.
/cpuprobe.exe
/cpuprobe.pdb

# The bare-metal firmware builds into its own target dir (it is not a
# workspace member, so the root /target rule does not cover it).
bare-metal/*/target/
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ based on [Keep a Changelog](https://keepachangelog.com/); this project uses

## [Unreleased]

### Added -- the bare-metal claim, run on silicon (ESP32-S3)

CI proves rusty_zstd COMPILES for Cortex-M4F and RV32. That is a different
claim from running, so this one was run: `bare-metal/esp32s3` is a `no_std +
alloc` firmware that compresses and decompresses on the part and compares the
result byte for byte against the source.

```
census64::CENSUS_LIVE = false (false is expected here: no 64-bit atomics)
source 8260 bytes
L1 8260 -> 468 bytes (17.65x) round trip OK
L3 8260 -> 426 bytes (19.39x) round trip OK
L5 8260 -> 263 bytes (31.41x) round trip OK
RESULT: PASS -- compressed and decompressed on the board
```

Three levels because they are three different match finders: Fast, DFast and
Greedy. Xtensa LX7 is 32-bit, so every census counter on that part is the
`census64` stub -- which makes the board the exact configuration the fix
created, and the `PASS` the evidence that stubbing the instrument left the
codec alone.

It is excluded from the workspace and hand-run: it needs Espressif's Rust fork,
which CI does not have. It claims no timing and no heap floor; 192 KiB was
enough for 8 KiB of source at levels 1 to 5, and the crate sizes its tables
from the source length. See `bare-metal/esp32s3/README.md`.

### Fixed -- the census counters cost the crate BARE METAL; they no longer do

`cargo check -p rusty_zstd --no-default-features --features alloc` failed with
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ members = [
"crates/rzstd-alloc",
]

# The on-board proof (bare-metal/esp32s3) is a firmware crate for Xtensa: it
# needs Espressif's Rust fork and its own linker script, so it must not be a
# workspace member. Excluded, a plain `cargo build` at the root never sees it.
exclude = ["bare-metal/esp32s3"]

[workspace.package]
version = "0.2.5"
edition = "2021"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ Fetch the oracle with `pwsh scripts/fetch-oracle.ps1`, or point
| `no_std + alloc` | ✅ builds |
| `thumbv7em-none-eabihf` (Cortex-M4F) | ✅ builds (`no_std + alloc`) |
| `riscv32imac-unknown-none-elf` | ✅ builds (`no_std + alloc`) |
| ESP32-S3 (Xtensa LX7) | ✅ **round-trips on the board** ([proof](bare-metal/esp32s3/README.md)) |

AVX2 and NEON kernels are selected at **runtime**. On a CPU without them, the
scalar twins run and the output is identical.
Expand Down
15 changes: 15 additions & 0 deletions bare-metal/esp32s3/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[target.xtensa-esp32s3-none-elf]
runner = "espflash flash --monitor "
rustflags = [
"-C", "link-arg=-nostartfiles",
"-C", "link-arg=-Wl,-Tlinkall.x",
]

[build]
target = "xtensa-esp32s3-none-elf"

[env]
ESP_LOG = "info"

[unstable]
build-std = ["core", "alloc"]
Loading
Loading