Concept imagined by the user. README generated by Copilot.
This project presents a conceptual idea for a new computer architecture where memory and CPU are designed to natively understand and manage pointers and references. The goal is to address one of the most persistent sources of bugs in software development: unsafe or invalid memory access due to poor pointer management.
The memory safety model spans the full system stack:
-
Hardware
- Manages reference counts for all variables.
- Checks access hashes on every read/write.
- Automatically frees memory when
refcount == 0.
-
BIOS / Firmware
- Initializes the hardware reference system.
- Sets up global permissions and prepares reference hashes for authorized programs.
-
Operating System
- Distributes access hashes to programs according to policy.
- Ensures isolation between programs without performing per-access checks (hardware handles that).
-
Applications / Software
- Manipulate references securely.
- No direct memory management needed; unsafe pointer operations are impossible.
- Variables live only in RAM: Programs never manipulate raw addresses, only hardware-managed references.
- References are lightweight handles managed by the CPU, which internally tracks:
- The physical memory address
- A reference count (updated only on creation/destruction of a reference)
- Optional integrity hash and access permissions
- Automatic memory management: When the last reference to a variable is destroyed, the memory is freed automatically.
- Optional security: Hashes and permissions can be enabled for critical data, ensuring that only authorized programs can read/write.
- Performance flexibility: References can be created with or without hash checks, allowing trade-offs between speed and safety depending on the use case.
- Memory safety by design: Prevents
use-after-free, null dereference, and memory corruption. - Predictable performance: No runtime garbage collection pauses; hardware handles reference counting.
- Controlled inter-program access: Only programs with valid hashes can share references.
- Reduced developer burden: No manual memory management; safer code by default.
π Enhanced Memory Security with BIOS Control and Hash (Optional)
For critical variables, the system can enable a hash-based access control combined with BIOS-enforced reference limits:
Each reference is assigned a unique hash provided by the OS or the authorized program.
Only references with the correct hash can read or write the variable. Unauthorized access is blocked by the hardware.
Access is verified at reference registration, not at every read/write, preserving performance.
The BIOS can enforce a maximum number of simultaneous references per variable or per program. If the limit is reached, new reference requests are denied, even if the hash is correct.
Combined with reference counting, this allows precise tracking of how many programs are accessing a critical variable at any time.
Can have flags for only read or write/read.
π‘ The goal is to make memory access safer and more complex than traditional systems, while keeping flexibility for less sensitive variables.
Program A requests a variable -> OS issues reference + hash
Program A uses reference -> hardware updates refcount automatically
Reference goes out of scope -> refcount decreases
Refcount reaches 0 -> hardware frees memory
Program B attempts access -> hardware verifies hash; access denied if invalid
This is a conceptual idea imagined by the user. The user does not plan to develop this project themselves. This repository is intended to share the vision and invite experienced developers, researchers, and hardware architects to explore and experiment with the concept.
If you're interested in exploring this idea further, feel free to:
- Fork the repository
- Share your thoughts and improvements
- Prototype the concept in software or hardware simulation
This idea was born out Godot, when need adding features and must learn new langages and make another game engine.
More clear ?
SimpleTought β Memory with Stable References
Instead of working with raw memory addresses, we use protected references (small identifiers).
A central table translates these references into the actual values in memory.
Values can be moved / replaced / compacted without breaking the references.
Goals:
- Eliminate entire classes of bugs (dangling pointers, double free, memory corruption)
- Simplify memory management
- Enable hotβreload, streaming, and memory compaction
Cost: One extra indirection (mitigated by caches and inlined small values).
Status: Open concept β contributions and experiments welcome.
-
Stability
A reference is not a raw address: it stays valid even if the value moves. -
Simple Safety
If the value is freed, the generation changes β old references fail gracefully. -
Controlled Size
A reference should cost about the same as a pointer (~8 bytes); everything else lives in the table.
[ Ref (id, gen, flags) ] βββΊ [ Central Table ] βββΊ [ Value (RAM/VRAM/...) ] β² β ββ (thread-local cache) ββββββββββββββ