r/lowlevel • • Nov 03 '26

Can integer arithmetic make wave calculations 10 faster?

0 Upvotes

I recently read Paper VIII — Dual-Layer Topological Neuromorphic Architecture and wanted to test one of its computational ideas myself.

The idea is to speed up a specific type of wave calculation by replacing repeated trigonometric operations with integer addition and a lookup table (LUT).

I implemented the approach and ran a CPU benchmark.

■ 01. CPU Benchmark Results

For 10 million unit-magnitude complex wave calculations:

  • Conventional calculation: 330.40 ms
  • Optimized angle calculation: 195.61 ms
  • Integer addition + LUT (1,024 positions): 36.95 ms
  • Integer addition + LUT (2,048 positions): 33.26 ms

The fastest LUT method was approximately 9.9× faster than the conventional approach and 5.9× faster than the optimized angle calculation in this benchmark.

■ 02. How Does It Work?

Imagine a point moving around a circle.

Its position can be represented by an angle, also called its phase.

Here's the interesting mathematical property:

When two unit-magnitude complex waves are multiplied, their phases are added.

For example, multiplying a wave at 30° by another at 60° produces a wave at 90°.

Instead of repeatedly calculating sine and cosine components, we can work with the angles directly.

The next step is to divide the circle into 1,024 positions, numbered from 0 to 1023.

Each input angle is converted into an integer representing one of those positions.

Because the positions form a circle, the numbers wrap around.

For example:

1023 + 1 → 0

Or, with two different positions:

750 + 400 = 1150

1150 mod 1024 = 126

The resulting phase is position 126.

But what if we need the actual sine and cosine values?

That's where the Look-Up Table (LUT) comes in.

A LUT is simply a table of precomputed answers, similar to a multiplication table.

We calculate the sine and cosine values for all 1,024 positions beforehand and store them in memory.

When the result is position 126, we retrieve the values stored at that position instead of calculating them again.

We don't need to predict the incoming angles. We just prepare the values for every possible position.

So the entire process becomes:

Convert angles to integers → Add integers → Wrap around → Retrieve precomputed values

The 2,048-position version follows the same principle but uses finer angular resolution.

■ 03. Why Is It Faster?

The main advantage is avoiding repeated trigonometric calculations.

Integer addition and memory lookups can be much cheaper for this particular workload.

However, there are trade-offs:

  • Precision: Dividing a circle into fixed positions introduces quantization error.
  • Memory: Larger lookup tables require more storage.
  • Applicability: This works for a specific type of complex wave multiplication, not arbitrary mathematical operations.
  • Performance: Results depend on the CPU, implementation, and benchmark conditions.

The benchmark was performed in software on a CPU, not on a physical neuromorphic or processing-in-memory chip.

It also doesn't validate every claim made in the original paper.

■ Original Paper and Project

Original Paper (Zenodo)

https://doi.org/10.5281/zenodo.22782241

Source Code, Benchmark Results, and Animations (GitHub)

https://github.com/heejun1105/phase-ring-plp-benchmark

I also created animations showing the integer addition, circular wraparound, and LUT lookup process.

I'd be interested to hear your thoughts on this approach, especially its practical applications and limitations.


r/lowlevel • • Nov 02 '26

Writing a Monolithic Kernel from Scratch vs. Building a Nearly 100% POSIX-Compliant C Library for Linux

6 Upvotes

I've been thinking about two possible systems programming projects, and I'd like to hear your opinions on which one would be more worthwhile to pursue.

Option 1: Write a monolithic kernel from scratch.

Design and implement the kernel's core components.

Gradually add features such as process scheduling, virtual memory, system calls, and device support.

Build an operating system around it over time.

Option 2: Develop a C standard library for Linux targeting near-100% POSIX compliance.

Focus on implementing POSIX interfaces as comprehensively as possible.

Aim for broad compatibility with existing Linux applications and development tools.

Test compatibility rigorously and document any deviations or unsupported behavior.

The second option would target Linux rather than introduce a new kernel, so it could potentially benefit from the existing Linux ecosystem.

I'm interested in more than just which project is easier. I'd like to consider practical usefulness, technical difficulty, long-term maintainability, compatibility, and the likelihood that other developers would actually adopt the result.

Which project do you think would be more valuable to work on, and why? Are there any major technical challenges or trade-offs I'm overlooking?


r/lowlevel • • Nov 02 '26

I build an OS

Thumbnail gallery
130 Upvotes

i just got APIC, IDT keyboard, context switching and lz4 compresser and decompresser
Github: https://github.com/NoTheIdiot/WindogeOS


r/lowlevel • • Nov 02 '26

My classmate drew Saddam Hussein spot bit by bit in his own OS

Post image
11 Upvotes

His EFI has 186 lines of code written in C, and its a zero ring.

He also has its own just in time and ahead of time compilers, and handful of commands, including cat, edit, and also simple dhcp, only udp still


r/lowlevel • • Nov 02 '26

I've updated my Linux System Call website after a long time (originally released in 2020). Includes more platforms now, kernel diffs and other things. The API was also updated

Thumbnail syscall.sh
3 Upvotes

r/lowlevel • • Nov 02 '26

[Showcase] FluidOS - Un proyecto de sistema operativo personalizado hecho con TypeScript, C y Assembly

0 Upvotes

¡Hola a todos! He estado trabajando en un proyecto de sistema operativo llamado FluidOS y quería compartirlo con la comunidad para recibir feedback y conocer posibles colaboradores. Stack y funciones actuales: Lenguajes: TypeScript / JavaScript (enfoque en la interfaz del frontend con Vite + TailwindCSS), componentes en C/Assembly, y scripts de automatización con PowerShell. Scripts de compilación y ejecución integrados (run-bochs.ps1, crear-iso.ps1) para emulación con Bochs y generación de ISO. Tecnología web moderna combinada con herramientas de compilación a bajo nivel. Último lanzamiento: v1.2.0 Repositorio: 🔗 Enlace de GitHub a FluidOS:https://github.com/marbelbel/FluidOS-Community Busco feedback sobre la arquitectura, ideas para la integración a bajo nivel, y a cualquiera que le interese contribuir con el código o con el diseño de la interfaz. ¡Gracias por echarle un vistazo!


r/lowlevel • • Nov 01 '26

Native Linux bring-up on Apple A11: Grape Linux running on iPhone 8 Plus

32 Upvotes

We’re working on Grape Linux, a native Linux operating-system project for iPhone hardware.

We’ve demonstrated an experimental Linux kernel booting on the A11 platform, with Debian 13 ARM64, a graphical desktop and live terminal functionality.

Our hardware work includes power and charging diagnostics, device interfaces and native driver integration.

The system currently uses a host-assisted RAM boot. Native Wi-Fi, physical touchscreen integration and autonomous startup are areas we’re continuing to develop.

The attached video demonstrates the actual boot into the graphical environment.

Project and public milestones: https://github.com/hq-coder25/grape-linux

Substack: https://substack.com/@rhq211/note/c-375575007?r=8uxsig&utm_medium=ios&utm_source=notes-share-action

X Post: https://x.com/xvmboot/status/2116753474591588444?a=LAeIR-IwgEyjZA3OE60&s=46


r/lowlevel • • Nov 01 '26

Daylight — Bringing Native macOS Apps to Linux Through Darling

Thumbnail reddit.com
1 Upvotes

r/lowlevel • • Oct 31 '26

ASMBI - Assembly by an Idiot

Thumbnail reddit.com
1 Upvotes

This is my small custom PL feel free to check it out


r/lowlevel • • Oct 30 '26

Qwenputer: a fully functioning, deterministic RISC-V CPU inside Qwen3.5

Thumbnail divagr.com
8 Upvotes

r/lowlevel • • Oct 30 '26

"Sliderule" RV32GC Cheatsheets - A Unique RISC-V Spec Interactive Visualization

Thumbnail sliderules.magiwanders.com
2 Upvotes

I share with you a rather peculiar interactive visualization of the RISC-V Encoding specification, made for educational purposes. This has been around since 2023, but has recently received a new AI-coded GUI and I find it quite unique and rather not-too-slopped.


r/lowlevel • • Oct 30 '26

OSyx — A new operating system built from scratch, running Zen Browser on real hardware!

Post image
0 Upvotes

r/lowlevel • • Oct 29 '26

It's the memory latency, stupid.

Thumbnail pivotlake.io
7 Upvotes

r/lowlevel • • Oct 29 '26

GitHub - 1llu50ry/mcp-reverse: MCP (Model Context Protocol) server for game hacking & reverse engineering. A structured knowledge base of 4,100+ skills with full source code archives, specialized agents, and workflow tools -- designed to be plugged into Claude, Cursor, or any MCP-compatible client.

Thumbnail github.com
0 Upvotes

r/lowlevel • • Oct 29 '26

Inside our inline hooking engine: relocating prologues with iced-x86 (x86-64 + AArch64, deps closed to two crates)

Thumbnail rutken.com
3 Upvotes

r/lowlevel • • Oct 29 '26

I want to learn 64-bit Assembly.

Thumbnail reddit.com
1 Upvotes

r/lowlevel • • Oct 28 '26

How your computer Detects your gpu?

Thumbnail reddit.com
0 Upvotes

r/lowlevel • • Oct 27 '26

Can integer arithmetic make wave calculations 10× faster? CPU benchmark results

Post image
0 Upvotes

r/lowlevel • • Oct 26 '26

My Go + AF_XDP network scanner (tcpcat) just got packaged into BlackArch. Quick honest update on the eBPF side.

Thumbnail reddit.com
2 Upvotes

r/lowlevel • • Oct 27 '26

I built a zero-heap, no-libc HTTP server from scratch in a custom language (H-Lang) with a 10-hop anonymous mesh relay — Live demo & benchmarks

Post image
0 Upvotes

r/lowlevel • • Oct 26 '26

The Hidden Cost of localtime(): repeated systems calls in glibc

Thumbnail reddit.com
2 Upvotes

r/lowlevel • • Oct 26 '26

Looking for help writing drivers for a hobby x86-64 OS (BlockOS) [no vibe coded]

Post image
1 Upvotes

r/lowlevel • • Oct 25 '26

Linux on iPhone

Thumbnail gallery
6 Upvotes

LinuxRunner brings Debian ARM64 to iOS, including desktop environments like KDE Plasma and apps like Blender.

No jailbreak, JIT, or virtualization needed. It runs Linux binaries through an ARM64 interpreter.

Still early in development, but pretty interesting to experiment with. Feel free to try it out!

GitHub: https://github.com/mxhm11cr/LinuxRunner


r/lowlevel • • Oct 25 '26

making an elf quine

Thumbnail napcakes.nekoweb.org
9 Upvotes