diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index a200c6302c7..c66e5c20b99 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -24,6 +24,7 @@ _build_dependencies.sh @AffectedArc07
# Executables that need to be security-cleared
dreamchecker.exe @AffectedArc07
rustlibs.dll @AffectedArc07
+rustlibs_prod.dll @AffectedArc07
rust_g.dll @AffectedArc07
### S34NW
diff --git a/.github/workflows/build_rust.yml b/.github/workflows/build_rust.yml
index 1292c93dcb5..6039d640df8 100644
--- a/.github/workflows/build_rust.yml
+++ b/.github/workflows/build_rust.yml
@@ -82,6 +82,10 @@ jobs:
cp target/i686-unknown-linux-gnu/release/librustlibs.so ../tools/ci/librustlibs_ci.so
cp target/i686-pc-windows-gnu/release/rustlibs.dll ../rustlibs.dll
+ # Build the para-specific version
+ RUSTFLAGS='-C target-cpu=raptorlake' cargo build --release --target=i686-pc-windows-gnu
+ cp target/i686-pc-windows-gnu/release/rustlibs.dll ../rustlibs_prod.dll
+
git commit -a -m "Build Rust library" --allow-empty
git push origin
diff --git a/code/__DEFINES/rust.dm b/code/__DEFINES/rust.dm
index 07242e955f5..0c337d93554 100644
--- a/code/__DEFINES/rust.dm
+++ b/code/__DEFINES/rust.dm
@@ -8,6 +8,15 @@
/* This comment bypasses grep checks */ /var/__rustlib
+// IF we are on the production box, use a dll that has 0 compatibility of working with normal people's CPUs
+// This works by allowing rust to compile with modern x86 instructionns, instead of compiling for a pentium 4
+// This has the potential for significant speed upgrades with SIMD and similar
+#ifdef PARADISE_PRODUCTION_HARDWARE
+#define RUSTLIBS_SUFFIX "_prod"
+#else
+#define RUSTLIBS_SUFFIX ""
+#endif
+
/proc/__detect_rustlib()
if(world.system_type == UNIX)
#ifdef CIBUILDING
@@ -16,27 +25,34 @@
return __rustlib = "tools/ci/librustlibs_ci.so"
#endif
// First check if it's built in the usual place.
- if(fexists("./rust/target/i686-unknown-linux-gnu/release/librustlibs.so"))
- return __rustlib = "./rust/target/i686-unknown-linux-gnu/release/librustlibs.so"
+ if(fexists("./rust/target/i686-unknown-linux-gnu/release/librustlibs[RUSTLIBS_SUFFIX].so"))
+ return __rustlib = "./rust/target/i686-unknown-linux-gnu/release/librustlibs[RUSTLIBS_SUFFIX].so"
// Then check in the current directory.
- if(fexists("./librustlibs.so"))
- return __rustlib = "./librustlibs.so"
+ if(fexists("./librustlibs[RUSTLIBS_SUFFIX].so"))
+ return __rustlib = "./librustlibs[RUSTLIBS_SUFFIX].so"
// And elsewhere.
- return __rustlib = "librustlibs.so"
+ return __rustlib = "librustlibs[RUSTLIBS_SUFFIX].so"
else
// First check if it's built in the usual place.
- if(fexists("./rust/target/i686-pc-windows-msvc/release/rustlibs.dll"))
- return __rustlib = "./rust/target/i686-pc-windows-msvc/release/rustlibs.dll"
+ if(fexists("./rust/target/i686-pc-windows-msvc/release/rustlibs[RUSTLIBS_SUFFIX].dll"))
+ return __rustlib = "./rust/target/i686-pc-windows-msvc/release/rustlibs[RUSTLIBS_SUFFIX].dll"
// Then check in the current directory.
- if(fexists("./rustlibs.dll"))
- return __rustlib = "./rustlibs.dll"
+ if(fexists("./rustlibs[RUSTLIBS_SUFFIX].dll"))
+ return __rustlib = "./rustlibs[RUSTLIBS_SUFFIX].dll"
+
// And elsewhere.
- return __rustlib = "rustlibs.dll"
+ var/assignment_confirmed = (__rustlib = "rustlibs[RUSTLIBS_SUFFIX].dll")
+ // This being spanned over multiple lines is kinda scuffed, but its needed because of https://www.byond.com/forum/post/2072419
+ return assignment_confirmed
+
#define RUSTLIB (__rustlib || __detect_rustlib())
#define RUSTLIB_CALL(func, args...) call_ext(RUSTLIB, "byond:[#func]_ffi")(args)
+// This needs to go BELOW the above define, otherwise the BYOND compiler can make the above immediate call disappear
+#undef RUSTLIBS_SUFFIX
+
/proc/milla_init_z(z)
return RUSTLIB_CALL(milla_initialize, z)
diff --git a/code/datums/revision.dm b/code/datums/revision.dm
index 5b843266268..a02c104c332 100644
--- a/code/datums/revision.dm
+++ b/code/datums/revision.dm
@@ -91,6 +91,11 @@ GLOBAL_PROTECT(revision_info) // Dont mess with this
msg += "Server Revision Info"
// Round ID first
msg += "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]"
+ #ifdef PARADISE_PRODUCTION_HARDWARE
+ msg += "Production-hardware specific compile: Yes"
+ #else
+ msg += "Production-hardware specific compile: No"
+ #endif
// Commit info
if(GLOB.revision_info.commit_hash && GLOB.revision_info.commit_date && GLOB.configuration.url.github_url)
diff --git a/rustlibs.dll b/rustlibs.dll
index 2390f2853c5..b1b620b7506 100644
Binary files a/rustlibs.dll and b/rustlibs.dll differ
diff --git a/rustlibs_prod.dll b/rustlibs_prod.dll
new file mode 100644
index 00000000000..355c4be3540
Binary files /dev/null and b/rustlibs_prod.dll differ
diff --git a/tools/ci/librustlibs_ci.so b/tools/ci/librustlibs_ci.so
index 0b7d30ea286..32ff2a40325 100644
Binary files a/tools/ci/librustlibs_ci.so and b/tools/ci/librustlibs_ci.so differ