Skip to content

V3.0.0#5

Merged
NullSablex merged 10 commits into
masterfrom
v3.0.0
May 17, 2026
Merged

V3.0.0#5
NullSablex merged 10 commits into
masterfrom
v3.0.0

Conversation

@NullSablex

Copy link
Copy Markdown
Owner

No description provided.

- cargo bench -p samp-sdk: evita erro 'save-baseline' nos unit tests dos demais crates
- actions/checkout: v4 → v6
- actions/upload-artifact: v4 → v7
- actions/cache/restore e cache/save: v4 → v5
…ganization

Pure-Rust implementation of the Open Multiplayer component ABI
(Itanium on Linux, MSVC on Windows). A single binary now works as a
SA-MP plugin and as a native Open Multiplayer component with no
extra configuration. No C/C++, no bindgen.

Breaking changes

- SampPlugin::process_tick renamed to on_server_tick; it now fires on
  both servers (ProcessTick on SA-MP, 5 ms ITimersComponent timer on
  native Open Multiplayer).
- samp::plugin::enable_process_tick renamed to enable_server_tick.
- samp::cell::string::put_in_buffer is now pub(crate). The public API
  for writing strings is Buffer::write_str / UnsizedBuffer::write_str.
- samp_sdk::raw::functions::Logprintf changed from variadic to fixed
  arity (fn(*const i8)) — the SDK formats in Rust and passes a single
  C string, ABI-equivalent to logprintf("%s", msg).
- Example crates renamed: example-hello/ -> examples/hello/,
  example-counter/ -> examples/counter/, plugin-example/ -> examples/advanced/.

Added

- samp_sdk::omp module with eight submodules (component,
  component_api, core, events, server, timers, types, vtable)
  covering IComponent, IUIDProvider, IPawnComponent, IPawnScript,
  IEventDispatcher, ITimersComponent and ICore::ILogger.
- samp::plugin: enable_server_tick, omp_core, omp_query_component,
  omp_query::<T> (typed wrapper via OmpComponentHandle).
- SampPlugin: new hooks on_server_tick, on_omp_ready,
  on_component_free (the last two gated by not(feature = "samp-only")).
- initialize_plugin!: optional uid, component_name and
  component_version fields. Resolution chain
  macro > [package.metadata.samp] > derived; UID generated via
  FNV-1a 64 of CARGO_PKG_NAME@CARGO_PKG_VERSION and persisted to
  Cargo.toml.
- #[native] accepts associated functions, bare T returns (in addition
  to Result/AmxResult), &T arguments with auto-borrow, compile-time
  validation of interior NULs in the name literal, and panic capture
  via catch_unwind.
- samp-only feature on samp and samp-sdk: full opt-out of every Open
  Multiplayer code path.
- pub use log in the samp crate so the macro does not require the
  log crate as a direct dependency of user plugins.
- scripts/build-{linux,windows}.sh plus Python helpers for the
  benchmark pipeline.
- New workflows: docs.yml, release.yml, release-drafter.yml,
  labels.yml, bench-release.yml. rust.yml action versions bumped.
- 4 READMEs under examples/ (index + one per plugin).
- Test coverage: 80 -> 207 (+127) unit tests.
- buffer_bench (Criterion); string_bench reworked with
  std::hint::black_box.

Changed

- SDK diagnostics routed through log::warn! with the [rust-samp]
  prefix.
- Default log routing on native Open Multiplayer goes through
  ICore::logLnU8, mapping log::Level -> samp_sdk::omp::LogLevel.
- Adaptive bootstrap of getAmxFunctions(): tried in on_init, retried
  in on_ready; AMX scripts that arrive before the function table is
  available are queued and processed once it is.
- omp_cleanup kills the tick timer and removes the PawnEventHandler
  from the dispatcher before unload, preventing use-after-free.
- samp-codegen error messages are fully in English.
- Compile-time OmpComponent layout asserts (offset_of / size_of) for
  Linux i686 and MSVC i686.

Documentation

- mdBook removed (docs/book.toml + docs/src/*) and replaced by a
  MkDocs Material site under docs/, entirely in English. New pages:
  exec-public, build-scripts, diagnostics, internals/omp-abi.
- README, samp-sdk/readme.md, samp-codegen/readme.md and
  migration.md rewritten in English.
- CHANGELOG split: current release at the root, previous ones under
  changelog/ (v1.x.md, v2.x.md, historical.md for the pre-fork samp-rs).
- Source docstrings translated to English.

Repository hygiene

- .gitignore consolidated; new ignores for dist/, site/, bench
  artefacts, __pycache__, release_body.md, rust-samp-*-src.tar.gz
  and editor/OS junk.
- New .gitattributes with export-ignore so docs, examples, scripts,
  .github/, changelog/, notes/, mkdocs.yml, ROADMAP.md, CHANGELOG.md
  and migration.md are excluded from GitHub's auto-generated source
  archives. Also normalizes eol=lf for Windows checkouts.
- release.yml hardened: defensive --exclude flags on tar plus a
  verification step that fails the release if any forbidden path
  slips into the SDK source tarball.
- Cargo.lock now committed.

Versions

- samp 2.2.0 -> 3.0.0
- samp-sdk 2.2.0 -> 3.0.0
- samp-codegen 1.2.0 -> 1.3.0

Compatibility

- i686-unknown-linux-gnu: SA-MP + native Open Multiplayer (Itanium).
- i686-pc-windows-msvc: SA-MP + native Open Multiplayer (MSVC).
- i686-pc-windows-gnu: SA-MP (combine with the samp-only feature).
@github-actions

github-actions Bot commented May 17, 2026

Copy link
Copy Markdown

Benchmark results

Before: 5/merge · commit b3b96402
After: #5 (v3.0.0) · commit bfe2ca9f · workflow run

Benchmark Before After Change
amx_string_new/len/1024 0.55 ns 0.62 ns +14.41% 🚨
amx_string_new/len/256 0.55 ns 0.62 ns +13.82% 🚨
amx_string_new/len/64 0.55 ns 0.62 ns +14.22% 🚨
amx_string_new/len/8 0.55 ns 0.62 ns +14.05% 🚨
baseline_from_utf8_lossy/len/1024 337.64 ns 393.53 ns +16.55% 🚨
baseline_from_utf8_lossy/len/256 101.98 ns 116.39 ns +14.12% 🚨
baseline_from_utf8_lossy/len/64 40.04 ns 53.08 ns +32.59% 🚨
baseline_from_utf8_lossy/len/8 21.36 ns 28.11 ns +31.61% 🚨
buffer_get_as_f32/len/1024 814.71 ns 942.78 ns +15.72% 🚨
buffer_get_as_f32/len/256 187.61 ns 222.54 ns +18.62% 🚨
buffer_get_as_f32/len/64 32.79 ns 38.04 ns +16.02% 🚨
buffer_get_as_f32/len/8 3.29 ns 3.90 ns +18.78% 🚨
buffer_iter_as_f32/len/1024 800.47 ns 923.72 ns +15.40% 🚨
buffer_iter_as_f32/len/256 169.23 ns 206.82 ns +22.21% 🚨
buffer_iter_as_f32/len/64 29.87 ns 35.72 ns +19.60% 🚨
buffer_iter_as_f32/len/8 2.46 ns 3.11 ns +26.69% 🚨
buffer_iter_as_i32/len/1024 42.06 ns 55.23 ns +31.31% 🚨
buffer_iter_as_i32/len/256 11.46 ns 13.11 ns +14.39% 🚨
buffer_iter_as_i32/len/64 3.82 ns 4.38 ns +14.50% 🚨
buffer_iter_as_i32/len/8 1.59 ns 1.88 ns +17.84% 🚨
buffer_set_as_bool/len/1024 0.28 ns 0.32 ns +15.89% 🚨
buffer_set_as_bool/len/256 0.28 ns 0.32 ns +14.80% 🚨
buffer_set_as_bool/len/64 0.28 ns 0.32 ns +14.00% 🚨
buffer_set_as_bool/len/8 0.28 ns 0.31 ns +13.29% 🚨
buffer_write_str/len/1024 0.28 ns 0.31 ns +13.80% 🚨
buffer_write_str/len/256 0.28 ns 0.32 ns +12.44% 🚨
buffer_write_str/len/64 0.28 ns 0.32 ns +15.62% 🚨
buffer_write_str/len/8 0.28 ns 0.32 ns +13.98% 🚨
deref_cached/len/1024 0.55 ns 0.62 ns +13.67% 🚨
deref_cached/len/256 0.55 ns 0.62 ns +14.07% 🚨
deref_cached/len/64 0.55 ns 0.62 ns +14.22% 🚨
deref_cached/len/8 0.55 ns 0.63 ns +14.51% 🚨
deref_first_access/len/1024 0.55 ns 0.62 ns +14.32% 🚨
deref_first_access/len/256 0.55 ns 0.62 ns +13.86% 🚨
deref_first_access/len/64 0.55 ns 0.62 ns +14.34% 🚨
deref_first_access/len/8 0.55 ns 0.62 ns +14.34% 🚨
to_bytes_packed/len/1024 1.16 µs 1.83 µs +57.18% 🚨
to_bytes_packed/len/256 304.30 ns 466.38 ns +53.26% 🚨
to_bytes_packed/len/64 83.91 ns 135.60 ns +61.59% 🚨
to_bytes_packed/len/8 23.94 ns 33.16 ns +38.54% 🚨
to_bytes_unpacked/len/1024 1.15 µs 2.28 µs +98.39% 🚨
to_bytes_unpacked/len/256 292.93 ns 576.62 ns +96.85% 🚨
to_bytes_unpacked/len/64 81.57 ns 158.42 ns +94.22% 🚨
to_bytes_unpacked/len/8 23.00 ns 36.41 ns +58.26% 🚨
write_str/len/1024 0.28 ns 0.31 ns +13.39% 🚨
write_str/len/256 0.28 ns 0.31 ns +10.57% 🚨
write_str/len/64 0.28 ns 0.32 ns +12.14% 🚨
write_str/len/8 0.28 ns 0.31 ns +10.99% 🚨

Summary: 48 compared · 0 faster · 48 slower · 0 new · 0 removed


Emoji legend: 🚀 large speedup · ✨ minor speedup · ⚠️ minor regression · 🚨 large regression · thresholds 5% / 10%. Changes below the minor threshold are considered noise.

Replace the unified server tick hook with `on_tick(TickContext)` and add
`TickConfig`, `TickSource`, `enable_tick`, and `enable_tick_with`.

Track elapsed time between tick dispatches, expose the tick source for SA-MP
and Open Multiplayer, and allow plugins to configure per-server tick behavior
and Open Multiplayer timer intervals.

Update codegen, runtime dispatch, examples, migration notes, API docs, and the
changelog for the new tick API.
@NullSablex
NullSablex merged commit 7402b7e into master May 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant