SNAPKITTYWEST commited on
Commit
799fcd4
·
verified ·
1 Parent(s): 09b110a

Model card: restore full README from GitHub, add commercial license option

Browse files
Files changed (1) hide show
  1. README.md +152 -0
README.md CHANGED
@@ -15,3 +15,155 @@ tags:
15
 
16
  > Mirrored from [https://github.com/SNAPKITTYWEST/repoverse](https://github.com/SNAPKITTYWEST/repoverse) at commit `90d5c60`. Part of the **SnapKitty October 2026 main drop**.
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  > Mirrored from [https://github.com/SNAPKITTYWEST/repoverse](https://github.com/SNAPKITTYWEST/repoverse) at commit `90d5c60`. Part of the **SnapKitty October 2026 main drop**.
17
 
18
+ # Repoverse: engine-independent core
19
+
20
+ This is the C# domain core of **SNAPKITTY REPOVERSE** (Master Directive, Part I). It turns GitHub
21
+ repositories into a deterministic world manifest and a chunked voxel world. Open `Repoverse.sln` in Rider.
22
+
23
+ ```
24
+ GitHub / local git ──► CanonicalRepository ──► Classifier ──► WorldManifest ──► WorldGenerator ──► Chunk ──► GreedyMesher
25
+ (Ingestion/) (Model/) (Generation/) (Generation/) (Voxels/) (Voxels/)
26
+ ```
27
+
28
+ Nothing in `Repoverse.Core` depends on Unreal. The engine consumes the manifest and chunk data. It
29
+ never becomes the source of truth (§5).
30
+
31
+ ## What is built and tested
32
+
33
+ | Directive § | What exists | Where |
34
+ |---|---|---|
35
+ | 6 Canonical model | GitHub facts, kept separate from derived values; every derived value carries `Provenance` | `Model/` |
36
+ | 25–27 Ingestion | GitHub REST client: `Link` pagination, ETag conditional requests with a disk cache, rate-limit detection, failures isolated per repo. Local-git ingester for offline use and monorepos | `Ingestion/GitHubIngest.cs`, `LocalGitIngest.cs` |
37
+ | 27 Offline | Merges snapshots per repo. An empty or rate-limited refresh never replaces good data; unreached repos are kept and marked stale | `Ingestion/SnapshotStore.cs` |
38
+ | 8 Seeds | FNV-1a and SplitMix64, stable across processes and platforms (`string.GetHashCode` is not) | `Generation/Seed.cs` |
39
+ | 9–10, 80, 82–83 | Rule-based classifier with whole-word keyword scoring (purpose outweighs language), districts, archetypes, JSON overrides, landmarks | `Generation/Classifier.cs`, `Overrides.cs` |
40
+ | 7, 85 Manifest | Deterministic manifest. Placement is sticky: existing buildings keep their plot when repos are added | `Generation/ManifestBuilder.cs` |
41
+ | 78–79, 87–89 Interiors | Room graph built from the directory tree, with ignore rules (`node_modules`, `target`…) and semantic compression down to a room budget. Reachability is validated | `Generation/RoomGraph.cs` |
42
+ | 11–12 Voxels | 16-bit packed voxels, 32³ chunks (64 KiB each). Interactive objects are entities, not voxels | `Voxels/Voxel.cs`, `BuildingRasterizer.cs` |
43
+ | 11, 13 Streaming | Nearest-first async generation on the thread pool, bounded in-flight work, hysteresis unloading, cancellation. Player edits are stored apart from procedural state | `Voxels/ChunkStreamer.cs`, `WorldGenerator.cs` |
44
+ | 14 Meshing | Greedy mesher with cross-chunk face culling and per-material draw groups | `Voxels/GreedyMesher.cs` |
45
+ | 26, 32 Events | Typed events computed by diffing two snapshots (added, archived, release, activity, structure…) | `Simulation/WorldEvents.cs` |
46
+ | 31 Clock | Fixed-step simulation clock, decoupled from frame rate: speed, pause, scheduling, spiral-of-death guard | `Simulation/SimulationClock.cs` |
47
+ | 42–43 Saves | Versioned save of player state and edits, with a v1→v2 migration. Saves from a newer build are refused | `Persistence/SaveGame.cs` |
48
+ | 76–77 URIs | `repoverse://owner/repo/path#L12`, `?room=`, `@x,y,z`; maps back to GitHub URLs | `RepoverseUri.cs` |
49
+
50
+ There are 72 xUnit tests (`tests/`). They check behaviour, not constructors: determinism, sticky placement, no
51
+ overlapping plots, room reachability found by flood-filling walkable air in the rasterized geometry, greedy
52
+ quads covering exactly the visible faces, streaming memory bounded while travelling, edits surviving
53
+ unload/reload, ETag cache hits, rate limits, partial failures, offline fallback, token redaction, save
54
+ migration, and URI round-trips.
55
+
56
+ ## Run it
57
+
58
+ Requires the .NET 8 SDK and git.
59
+
60
+ ```bash
61
+ dotnet test
62
+ # Offline: any git checkout works; --subprojects treats each top-level folder as a repo.
63
+ git clone https://github.com/SNAPKITTYWEST/BOBS-Many-Voxel-Worlds.git ../BOBS-Many-Voxel-Worlds
64
+ dotnet run --project src/Repoverse.Cli -- ingest-local ../BOBS-Many-Voxel-Worlds --owner SNAPKITTYWEST --subprojects --out out/snapshot.json
65
+ dotnet run --project src/Repoverse.Cli -- generate --snapshot out/snapshot.json --out out/manifest.json
66
+ dotnet run --project src/Repoverse.Cli -- stats --manifest out/manifest.json
67
+ dotnet run --project src/Repoverse.Cli -- export-mesh --manifest out/manifest.json --out preview/world-mesh.json
68
+ # then serve preview/ (e.g. `python3 -m http.server -d preview`) and open index.html?focus=snapkittywest/quantum-world
69
+
70
+ # Live GitHub (token read from the environment, never stored):
71
+ GITHUB_TOKEN=... dotnet run --project src/Repoverse.Cli -- ingest-github SNAPKITTYWEST --out out/snapshot.json
72
+ ```
73
+
74
+ On the 15 sub-projects of `BOBS-Many-Voxel-Worlds`: 15 buildings, about 60 chunks generated in 30–40 ms,
75
+ and about 170k visible faces meshed into about 7.2k quads (about 4% of naive).
76
+
77
+ `preview/index.html` is a Three.js developer view of the exported mesh, used to check the generator by
78
+ eye. It is not the game renderer.
79
+
80
+ ## Unified engine: compute kernels to WebAssembly
81
+
82
+ `unified-engine/` is a JavaScript compiler that takes CUDA-style `__global__` kernels and turns them into
83
+ WebAssembly, plus a host runtime that runs them. It needs Node 22+ and has no native dependencies.
84
+
85
+ | Stage | Files |
86
+ |---|---|
87
+ | Lexer, parser → AST | `kernel/compiler/lexer.js`, `parser.js`, `kernel/ast/ast.js` |
88
+ | AST → typed, structured IR (C scoping and conversions, short-circuit `&&`/`\|\|`) | `kernel/ir/lowering.js`, `kernel/ir/ir.js` |
89
+ | IR → wasm binary (no external toolchain) | `wasm/modules/codegen.js`, `encoder.js`, `wasm/abi/abi.js` |
90
+ | Shared memory, typed device buffers, `launch({grid, block})` | `wasm/runtime/runtime.js` |
91
+
92
+ ```bash
93
+ cd unified-engine && npm ci && npm test # 55 tests, including a particle-physics step
94
+ ```
95
+
96
+ ```js
97
+ const runtime = new KernelRuntime();
98
+ const add = await runtime.load(`__global__ void add(const float* A, const float* B, float* C, int N) {
99
+ int i = blockIdx.x * blockDim.x + threadIdx.x; if (i < N) C[i] = A[i] + B[i]; }`);
100
+ const C = runtime.alloc('f32', n);
101
+ add.launch({ grid: Math.ceil(n / 256), block: 256 }, runtime.upload(a), runtime.upload(b), C, n);
102
+ C.read();
103
+ ```
104
+
105
+ Limits: x dimension only, one kernel per module, no `__device__` functions, and no per-buffer bounds checks.
106
+ The `test:lua`, `build:kernel` and `demo` scripts point at layers that are not written yet.
107
+
108
+ ## UNIFY: 2D engine runtime and demo game
109
+
110
+ `unify/` is a C++17 2D game engine (renderer, physics, audio, input, animation, ECS, Lua 5.4 gameplay, save
111
+ states, rollback buffer), with its own CUDA-like kernel compiler and WASM interpreter, and a small platformer in
112
+ `unify/game/` that exercises all of it. It was merged here with its history kept (`git subtree`). See
113
+ [`unify/README.md`](unify/README.md).
114
+
115
+ ```bash
116
+ cd unify
117
+ cmake -S . -B build -G Ninja
118
+ cmake --build build
119
+ ctest --test-dir build --output-on-failure # 58 tests + the definition-of-done playtest
120
+ ./build/unify_game # SDL2 window if libsdl2-dev is installed, else --headless
121
+ ```
122
+
123
+ This builds on Linux (GCC or Clang) and on Windows with MinGW-w64 GCC. MSVC is not supported. The Unreal backend in
124
+ `unify/backends/unreal` has never been compiled.
125
+
126
+ `unify/engine/kernel` + `unify/engine/wasm` and `unified-engine/` are two independent implementations of the
127
+ same kernel → WASM idea (C++ with its own interpreter, and JavaScript running on the host's WebAssembly). They don't
128
+ share code yet.
129
+
130
+ ## Not built yet
131
+
132
+ These need tools this repository's CI and cloud sessions don't have. They are left out rather than stubbed (§2):
133
+
134
+ - **Unreal / C++**: the engine project, the chunk-mesh upload (`ChunkMesh.Quads` maps directly onto
135
+ `UProceduralMeshComponent` or a RealtimeMesh), and Lumen/Nanite materials.
136
+ - **Swift control plane** (§33–34) and the **CSS token layer** (§35) for in-engine UI.
137
+ - **CAD import pipeline** (§24).
138
+ - **Dependency extraction**: the `DependsOn` edges are modelled and rendered into the manifest, but not yet
139
+ parsed from `Cargo.toml`, `package.json` and similar files.
140
+ - Parts II and III of the directive (agents, simulation, 388-repo scale, packaging).
141
+
142
+ ## Known limits
143
+
144
+ - Classification is keyword and file-extension rules. `.v` counts as both Coq and Verilog. Ties
145
+ break by category order, and the provenance string shows when that happened. Use `overrides.json` for intent.
146
+ - One floor plan (a corridor spine) for every archetype. Archetype-specific shells are future work.
147
+ - The local ingester's "releases" are git tags, and only for whole-repo ingests.
148
+
149
+ ## SNAPKITTY game and Unreal host
150
+
151
+ [Play/build guide](docs/SNAPKITTY-GAME.md) · [Unreal setup](unreal/README.md)
152
+
153
+ The Unify launcher now opens an asset-backed SNAPKITTY menu, a playable Bifrost Runner level, and a read-only repository browser exported from the C# manifest. The same Lua game and artwork are wired into an Unreal host project. See the guides for verified native behavior and the Unreal compilation boundary.
154
+
155
+ ## 3D world bridge (engine validation pending)
156
+
157
+ The C# sidecar and native Unreal district client are implemented in
158
+ `src/Repoverse.Sidecar`, `src/Repoverse.Core/Bridge`, and the existing Unreal
159
+ module. [Build instructions and exact validation boundary](docs/REPOVERSE-3D.md).
160
+ The service is tested; the Unreal client still requires UBT compilation and a
161
+ real editor playthrough. The older handoff task list remains historical context.
162
+
163
+ ---
164
+
165
+ ### 💼 Commercial License
166
+
167
+ This repository is published without an open-source license; all rights are reserved. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC grants the rights to use, modify and ship this code.
168
+
169
+ **[→ Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20repoverse)** · A.parr@belespritdaccord.uk