Skip to content

Instantly share code, notes, and snippets.

@CryZe
CryZe / float_max_survey.md
Last active March 24, 2024 21:13
Survey of Floating Point Implementations for Maximum

Survey of Floating Point Implementations for Maximum

Following some IEEE Standard

IEEE Std 754-2008 maxNum (NaN Absorb, 0 implementation defined)

  • C17 fmax
  • Rust f64::max
  • LLVM llvm.maxnum
  • ARM FMAXNM (either mode)
@CryZe
CryZe / lib.rs
Last active October 30, 2023 17:50
Protected memory
use std::{
marker::PhantomData,
mem,
ops::{Deref, DerefMut},
ptr::{self, NonNull},
};
use bytemuck::{AnyBitPattern, Zeroable};
mod utils;

My solution to this whole issue with Twitch's Community System would be to introduce a Tag based system instead. This is backwards compatible with the Community System. The idea would be that your stream has additional tags that specify additional information that can be searched for. So if you stream a Wind Waker 100% speedrun, you'd have these tags:

nintendo, zelda, wind waker, gamecube, japanese, speedrun, 100%

Now, it is obviously annoying to choose these tags, but the Game selection automatically implicitly selects the tags for this game for you, so for Wind Waker that would be:

nintendo, zelda, wind waker, gamecube

@CryZe
CryZe / PainPointsLiveSplitOneTechnologies.md
Last active June 14, 2023 08:43
Pain Points of LiveSplit One's Technologies

Pain Points of LiveSplit One's Technologies

npm

Works pretty well, but not having a lock file and accidentally relying on packages that are in the node_modules folder, but are not present in the package.json, causes some occasional breakages here and there.

webpack

Does what it's supposed to do. I can't think of any issues with it.

React

Fits the state model of livesplit-core really nicely and is a really good fit for LiveSplit One for that reason. The performance isn't all too great though. But that's really only a problem due to the 30 FPS refresh rate. For any normal web page React should be just fine.

@CryZe
CryZe / Performance.md
Created May 11, 2018 15:43
Web Timer Performance Comparison

Performance

All (sorted by CPU Usage)

Timer FPS CPU Usage
websplit 10 FPS ~5%
LiveSplit One 10 FPS ~9%
nwsplit 10 FPS ~16%
LiveSplit One 30 FPS ~18%
@CryZe
CryZe / component_coordinates.md
Last active June 14, 2023 08:43
Component Coordinates

Coordinate spaces used in livesplit-core

Backend Coordinate Space

The backend has its own coordinate space that ranges from 0 to 1 across both dimensions. (0, 0) is the top left corner of the rendered layout and (1, 1) is the bottom right corner. Since the coordinate space forms a square, the aspect ratio of the layout is not respected.

Renderer Coordinate Space

@CryZe
CryZe / ComponentSpaceDiagram.txt
Last active June 14, 2023 08:43
livesplit-core Component Space Diagram
^ ╔═══════════════════════════════════════════════════════════════════════════════════════════════╗
| ║ ^ ^ ║
| ║ | min(0.1 * H, 0.35) | 0.1 ║
| ║ v v ║
| ║ ╔════════════════╗ ^ ^ ╔═════════════════════════════╗ ^ ║
| ║ ║ ║ | | ║ ║ | ║
| ║ ║ ║ | | ║ ║ | Ascent ║
| ║ 0.35 ║ ║ | | ║ ║ | ║
H | ║ <----> ║ IMAGE ║ | dynamic

Auto Splitter Runtime - Language Support

Language Compiler Setup / Limitations Standard Library
TypeScript duktape Needs Web IDE Setup Everything but OS operations
JavaScript duktape Needs Web IDE Setup Everything but OS operations
Rust Rust wasm32-unknown-unknown or -wasi target Everything works with -wasi target
AssemblyScript AssemblyScript No builtin UTF-8 support Has optional WASI library for OS operations
Go tinygo Needs some flags, annotations and wasm-snip of at least io_get_stdout. Everything but OS operations
Python RustPython Needs Web IDE Setup and is slow
@CryZe
CryZe / paper_mario_damage.md
Last active June 14, 2023 08:42
Paper Mario Damage

Paper Mario Damage

Mario

Mario Damage
Base Damage 50 HP = 5
70 HP = 7
75 HP = 7
80 HP = 8
100 HP = 10
105 HP = 10
125 HP = 11
135 HP = 11
140 HP = 13
150 HP = 13
170 HP = 14
175 HP = 14
180 HP = 16
190 HP = 16
200 HP = 17
Hammer +5
Shiny Hammer +11
Golden Hammer +14
@CryZe
CryZe / Monotonic.md
Last active June 14, 2023 08:42
Notes on Monotonic Clocks

Notes on Monotonic Clocks

We can't use std's Instant as it's insufficiently specified. It neither guarantees "real time" nor does it guarantee measuring "uptime" (the time the OS has been awake rather than suspended), meaning that you can't actually rely on it in practice. In livesplit-core we definitely want real time rather than uptime. Various operating systems are problematic:

Linux, BSD and other Unixes