Skip to content
mendsecPublic

About

Spherical 3D desktop environment prototype in safe Rust and wgpu, designed around explicit trust domains. Linux and BSD.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

XSphereDE

A spherical 3D desktop environment prototype written in safe Rust, rendered with wgpu, designed around explicit trust domains.

CI License: MIT MSRV unsafe: forbidden Status: prototype

XSphereDE prototype: three curved windows with colored trust-domain borders inside the sphere, surrounded by volumetric code rain, with the Mini-Globe overview in the bottom-right corner

The v0.0.1 prototype: demo windows in three trust domains, with the Mini-Globe overview in the corner.

XSphereDE places you at the center of a 360° sphere. Windows are curved meshes that sit on the sphere at a position and depth $(\theta, \phi, r)$, and every window carries a compositor-drawn border that tells you which trust domain it belongs to. It revives the idea behind the classic SphereXP desktop and asks what it would look like if it were built today: memory-safe, GPU-native, Wayland-first, and with isolation as a visible, first-class concept instead of an afterthought.


Project status

Early prototype (v0.0.1). Not a daily driver, and not yet a security boundary.

What exists today is a single-process renderer and interaction model: the sphere, the camera, curved windows, the Mini-Globe overview, and the security policy engine, all exercised against built-in demo window surfaces. It does not yet host real applications.

What that means in practice:

  • It runs as a regular window on your existing desktop. It is not a Wayland compositor or a login session yet.
  • The trust-domain and clipboard-vault logic is implemented and unit-tested, but it has no untrusted clients to isolate yet. Do not rely on it to protect anything.
  • Interfaces, shortcuts, and file layout will change without notice until 0.1.0.

The path from here to a real compositor session is laid out in the roadmap, and that is exactly where contributors can have the most impact.


Why this project

  • Spatial workspaces without a headset. A sphere gives you far more usable surface than a flat plane, with depth as a third axis for arranging work, on ordinary monitors and ordinary GPUs.
  • Isolation you can see. Borrowing from the Qubes OS model, a window's trust level is part of the desktop's visual language and is drawn by the compositor, never by the application.
  • Hardened defaults, not hardened options. The policy baseline follows the direction set by projects such as secureblue: no Xwayland, no automatic thumbnailers, no third-party code inside the compositor.
  • A small, auditable codebase. About 3,300 lines of Rust and WGSL, seven direct dependencies, unsafe forbidden at the crate level.

Features

Spherical workspace

  • Geodesic wireframe sphere with meridians, parallels, a highlighted equator, and polar rings.
  • Smoothly damped camera with 360° orbital rotation and free flight inside the sphere.
  • Curved windows (16×12 subdivided meshes) that match the sphere's curvature at their own radius, adjustable from 4.0 m to 24.5 m.
  • Exact spherical raycasting for focus, hover, dragging across $(\theta, \phi)$, and depth adjustment.

Mini-Globe overview

  • An external 3D view of the sphere in the corner of the screen showing every window at its true radial depth.
  • Rotate it, adjust window depth from it, expand it to the center of the screen as an overview, or click any window or coordinate to fly the main camera there.

Volumetric code rain

  • Hundreds of 3D glyph ribbons generated procedurally in a WGSL shader; the camera can fly between the columns.
  • The effect never gets in the way of work: a clear radius around the viewer, a frontal reading cone, and a per-window angular shield keep the rain from covering any window.

Security model

These are the mechanisms implemented in src/security.rs and the compositor shader today. See project status for what they do and do not guarantee at this stage.

  • Trust domains. Every window is bound to one of four domains (CORE-VAULT, TRUSTED, SANDBOX, QUARANTINE). The colored frame is rendered by the compositor's own fragment shader on top of the window surface, so window content cannot draw or alter it.
  • Inter-domain clipboard vault. Copy and paste between windows goes through a compositor-owned vault on dedicated shortcuts, with an integrity check on the source and destination domains and a single-use wipe after paste.
  • Lockdown mode. One key blanks every window surface and wipes the vault.
  • Surface validation. Window buffers are bounds-checked against fixed dimension and size limits before they reach the GPU.
  • Shader integrity check. The WGSL source is hashed with SHA-256 and compared against a pinned digest before it is compiled.
  • Host audit. A read-only startup and on-demand (F12) report on relevant Linux kernel settings (ptrace_scope, kptr_restrict, dmesg_restrict; shown as n/a on other systems), injected-library environment variables, and allocator hardening.
  • Policy baseline. SecurityPolicy::maximum_hardened() declares the defaults the future compositor session will enforce: Xwayland off, no automatic thumbnailers, no third-party shell extensions, no setuid helpers.
  • Build hardening. unsafe_code = "forbid", integer overflow checks enabled in release builds, panic = "abort", fat LTO, stripped symbols, and a committed Cargo.lock.

Platform support

Platform Status
Linux (Wayland, X11) Primary development target
FreeBSD, NetBSD Compiles: cross-checked in CI on every change. Not yet tested at run time; expected to work through Vulkan or GLES. Reports welcome
OpenBSD Compiles: cross-checked in CI on every change with a nightly toolchain. Not yet tested at run time; see OpenBSD. Reports welcome
DragonFly BSD Untested. Reports and patches welcome
Windows, macOS Should run through wgpu and winit; not a project focus

If you run XSphereDE on a BSD or an unusual GPU and driver combination, please open an issue with the result, whether it worked or not.


Building and running

Requirements

  • Rust 1.88 or newer (rustup recommended).
  • A GPU driver exposing Vulkan, or OpenGL / GLES as a fallback.
  • On Linux and the BSDs, the usual desktop runtime libraries: libxkbcommon, plus libwayland-client or libX11. They are loaded at run time and are already present on virtually any desktop install.

Run

git clone https://github.com/mendsec/xspherede.git
cd xspherede
cargo run --release --locked

To see the security audit and policy messages, raise the log level:

RUST_LOG=info cargo run --release --locked

Test

cargo test --locked

OpenBSD

XSphereDE type-checks for OpenBSD in CI but has not been run there yet, so these steps are a starting point rather than a verified recipe. Please open a platform report with what you find.

  • rustup is not available on OpenBSD. Install the toolchain from packages and confirm that rustc --version reports 1.88 or newer:

    pkg_add rust git libxkbcommon vulkan-loader
  • Run from an X11 session. libxkbcommon is required; vulkan-loader is optional, and without it the renderer falls back to OpenGL / GLES.

  • The release profile uses fat LTO, which can exceed the default data size limit of a login class. Start with a debug build, or raise the limit with ulimit -d before a release build:

    RUST_LOG=info cargo run --locked
  • If no window appears, the RUST_LOG=info output shows the selected GPU and graphics backend, or the error that stopped startup. Include it in the report.


Controls

Action Control
Rotate the view Drag with the right mouse button, or the left button on the background
Toggle continuous free-look Space or Tab
Fly through the sphere Mouse wheel on empty space, or W A S D (Q / E for down / up, Shift to boost)
Move a window across the sphere Drag it with the left mouse button
Change a window's depth Hover the window (main view or Mini-Globe) and scroll
Rotate the Mini-Globe Drag it, or scroll over its empty space
Jump to a point or window Left click inside the Mini-Globe
Expand or collapse the Mini-Globe Right or middle click on it, or G
Copy focused window into the clipboard vault Ctrl + Shift + C
Paste from the clipboard vault Ctrl + Shift + V
Toggle lockdown mode L
Run the host security audit F12
Recenter at the sphere core R or Home
Toggle code rain speed M
Toggle fullscreen F11 or F
Collapse the Mini-Globe, or exit Esc

Architecture

xspherede/
├── Cargo.toml          # Manifest and hardened build profiles
├── Cargo.lock          # Pinned dependency graph
├── docs/               # Screenshots and media
└── src/
    ├── main.rs         # wgpu / winit setup, event loop, render pipelines, lockdown mode
    ├── camera.rs       # SphereCamera: damped spatial camera and NDC raycasting
    ├── window3d.rs     # SphericalWindow: curved meshes, spherical raycasting, WindowSurfaceProvider
    ├── minimap.rs      # MiniGlobeHud: interactive, expandable overview globe
    ├── sphere_env.rs   # Geodesic grid and code rain volume generation
    ├── security.rs     # TrustDomain, SecureClipboardVault, SecurityPolicy, audit, SHA-256
    └── shader.wgsl     # Grid, glyph, window, and trust-border shaders

The key extension point is the WindowSurfaceProvider trait in src/window3d.rs. Anything that can produce a title, a trust domain, dimensions, and an RGBA buffer can become a window on the sphere. The demo surfaces implement it today; real window sources are the next step.


Roadmap

Done:

  • Spherical workspace with 360° navigation and free flight
  • Curved windows with spherical raycasting, dragging, and radial depth
  • Interactive Mini-Globe overview with true-depth window rendering
  • Trust domains, clipboard vault, lockdown mode, and host audit
  • Volumetric code rain with reading cone and per-window shield

Next:

  • Live window capture through PipeWire, as the first real WindowSurfaceProvider
  • Native Wayland compositor session built on Smithay, with zero-copy DMA-BUF textures
  • Per-domain process isolation, so trust domains map to real sandboxes
  • Input routing to client surfaces through a trusted input path
  • Polar docks and launchers on the upper and lower rings
  • Spatial file manager, currently a concept prototype in XSphereDE Files
  • Verified BSD support and distribution packaging

Ecosystem

  • XSphereDE Files: the file manager concept for XSphereDE. Folders appear as a city whose structures show size and density, and a 3D sector map draws your route between folders and any pending copy or cut action. Try the live demo in your browser.

Contributing

Contributions are welcome, and the project is small enough that a first patch can land in an afternoon. Good places to start:

  • Test on your system. BSD, non-Mesa drivers, multi-monitor, and HiDPI reports are all valuable.
  • Pick a roadmap item. PipeWire capture and the Smithay session are the two that unlock everything else.
  • Review the security model. Design feedback from people who work on compositors, sandboxing, or hardened distributions is especially wanted. Use private reporting for anything sensitive.

Read CONTRIBUTING.md before opening a pull request, and note the Code of Conduct.


Security

Please do not open public issues for security vulnerabilities. See SECURITY.md for private reporting.


Acknowledgements

XSphereDE is an independent project. It is inspired by, and not affiliated with or endorsed by, any of the following:

  • SphereXP, the original spherical desktop, for the core idea.
  • Qubes OS, for trust domains and compositor-owned window decorations.
  • secureblue and GrapheneOS, for the hardened-by-default policy direction.
  • wgpu, winit, and Smithay, for making a project like this feasible in safe Rust.

License

Distributed under the MIT License. See LICENSE.

About

Spherical 3D desktop environment prototype in safe Rust and wgpu, designed around explicit trust domains. Linux and BSD.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages