Skip to content

Instantly share code, notes, and snippets.

View tiye's full-sized avatar
💭
Make Cirru great again!

题叶 tiye

💭
Make Cirru great again!
View GitHub Profile
@tiye
tiye / coredump.text
Created May 16, 2024 05:48
error from coredump
Program received signal SIGSEGV, Segmentation fault.
alloc::sync::{impl#50}::fmt<dyn core::any::Any, alloc::alloc::Global> (self=0x7fffffff5898, f=0x7fffffff3318) at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/sync.rs:3215
3215 /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/sync.rs: No such file or directory.
(gdb)
@tiye
tiye / core.text
Created May 16, 2024 03:43
sudo dmesg | tail
[13712422.135386] cr[977725]: segfault at 7f663efedd28 ip 000056087a1e2d0d sp 00007ffd5365e698 error 4 in cr[56087a098000+211000]
[13712422.135398] Code: 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f2 48 8b 07 48 8b 08 48 8b 70 08 <48> 8b 46 10 48 ff c8 48 83 e0 f0 48 8d 3c 08 48 83 c7 10 ff 25 0a
@tiye
tiye / quadratic.wgsl
Created May 12, 2024 04:15
quadratic
// https://sequelaencollection.home.blog/3d-chaotic-attractors/
// -0.875, -0.173, 0.307, -0.436, 0.598,
// 0.003, -0.039, 0.96, -0.84, 0.885,
// 0.774, 0.281, -0.015, 0.585, 0.442,
// -0.18, -0.535, -0.151, -0.971, -0.48,
// 0.777, 0.418, 0.185, 0.006, 0.45,
// -0.066, 0.498, 0.142, -0.246, -0.939
const a0 = -0.875; const a1 = -0.173; const a2 = 0.307; const a3 = -0.436; const a4 = 0.598;
const a5 = 0.003; const a6 = -0.039; const a7 = 0.96; const a8 = -0.84; const a9 = 0.885;
@tiye
tiye / compact.cirru
Created February 3, 2024 18:45
run with `cr -1 compact.cirru`
{} (:package |app)
:configs $ {} (:init-fn |app.main/main!) (:package |app) (:reload-fn |app.main/main!)
:modules $ []
:files $ {}
|app.lib $ %{} :FileEntry
:ns $ %{} :CodeEntry (:doc |)
:code $ quote (ns app.lib)
:defs $ {}
|call-lib $ %{} :CodeEntry (:doc |)
:code $ quote
@tiye
tiye / size.log
Created January 31, 2024 06:57
Calcit struct size
type: `calcit::Calcit`: 80 bytes, alignment: 8 bytes
discriminant: 1 bytes
variant `Fn`: 79 bytes
padding: 7 bytes
field `.name`: 16 bytes, alignment: 8 bytes
field `.def_ns`: 16 bytes
field `.id`: 16 bytes
field `.scope`: 8 bytes
field `.args`: 8 bytes
field `.body`: 8 bytes
struct Camera {
origin: vec3f,
forward: vec3f,
upward: vec3f,
}
struct Line {
start: vec3f,
direction: vec3f,
@tiye
tiye / crash log
Last active December 17, 2023 06:08
webgpu crashes Chrome
panic(cpu 1 caller 0xfffffe002bb6d218): userspace watchdog timeout: no successful checkins from WindowServer in 120 seconds
WindowServer has not exited since first loaded
service: logd, total successful checkins in 19605 seconds: 1853, last successful checkin: 0 seconds ago
service: WindowServer, total successful checkins in 19559 seconds: 1837, last successful checkin: 120 seconds ago
service: opendirectoryd, total successful checkins in 19605 seconds: 1853, last successful checkin: 0 seconds ago
service: configd, total successful checkins in 19605 seconds: 1852, last successful checkin: 0 seconds ago
Debugger message: panic
Memory ID: 0x1
OS release type: User
@tiye
tiye / demo.caddyfile
Created December 9, 2023 15:17
Caddy that serves /ws as WebSockets and others from static files
pumila.my.domain {
# Websockets, if headers match
handle /ws {
reverse_proxy localhost:11011
}
handle /* {
root * /web-assets/pumila/
file_server

@compute.toys is a playground for WebGPU compute shaders. Everything here is written in WGSL, which is WebGPU's native shader language. For up-to-date information on WGSL, please see the WGSL draft specification. You can also take a tour of WGSL.

Inputs

@compute.toys supplies keyboard input, mouse input, selectable input textures, custom values controlled by sliders, and the current frame and elapsed time.

Mouse input can be accessed from the mouse struct: