- Joined
- Dec 19, 2005
- Messages
- 17,564
since the community has been unable to source the 3d drivers for the Larrabee
DirectXGfx "under FreeBSD it's just running an x86 program called DirectXGfx (248 threads of it). And it shares a file system with the host and you can telnet into it and give it other work to do and steal cores from your own graphics system - it was mind-bending!"
(reference: https://tomforsyth1000.github.io/blog.wiki.html#[[Why didn't Larrabee fail?]])
View: https://www.youtube.com/watch?v=0qw-z2SBpE4
so.. i think Agentic AI is powerful enough to just build us the software to run games on the a KNF / Xeon Phi co-processor, or even Real prototype Larrabee.
---
using chatgpt, glm-4.7 and Kimi K3:
Check out this conversation I had
https://chat.kimik3.pro/f/NzUzQXcJTICv?c=upfHyZ
DirectXGfx "under FreeBSD it's just running an x86 program called DirectXGfx (248 threads of it). And it shares a file system with the host and you can telnet into it and give it other work to do and steal cores from your own graphics system - it was mind-bending!"
(reference: https://tomforsyth1000.github.io/blog.wiki.html#[[Why didn't Larrabee fail?]])
View: https://www.youtube.com/watch?v=0qw-z2SBpE4
so.. i think Agentic AI is powerful enough to just build us the software to run games on the a KNF / Xeon Phi co-processor, or even Real prototype Larrabee.
---
using chatgpt, glm-4.7 and Kimi K3:
Check out this conversation I had
https://chat.kimik3.pro/f/NzUzQXcJTICv?c=upfHyZ
erek said:Here is the complete, updated LRBni rasterizer driver with all corrections applied — correct 28.4 edge math, integer gather, safe framebuffer writes, and proper perspective interpolation.
```cpp
/*
* LRBni (Knights Ferry) Rasterizer — Final Corrected Version
*
* All vertex coordinates in 28.4 fixed-point (<< 4).
* Edge derivatives are per-pixel steps in 28.4 units.
* Pixel centers at (x*16 + 8, y*16 + 8).
* Edge values in 28.4^2 units (sign only matters for coverage).
*
* Intrinsic names are best guesses for ICC 12.x LRBni.
* Verify against actual zmmintrin.h before production use.
*/
#include <immintrin.h>
#include <stdint.h>
#include <math.h>
/* -----------------------------------------------------------------------
* Type definitions (unified register file, but compiler needs distinct types)
* ----------------------------------------------------------------------- */
typedef __m512 v16f; /* 16 floats */
typedef __m512 v16i; /* 16 integers in same register file */
/* -----------------------------------------------------------------------
* §1 Intrinsic wrappers — verify against zmmintrin.h
* ----------------------------------------------------------------------- */
/* Integer gather: load 32-bit values from base[index] with mask */
static inline v16i gather_epi32(const void* base, v16i indices, unsigned short mask)
{
/* LRBni: _mm512_mask_i32gather_epi32(src, base, index, mask, scale) */
v16i src = _mm512_setzero_epi32();
return _mm512_mask_i32gather_epi32(src, base, indices, mask, 4);
}
/* Extract 16-bit mask from vector of comparison results */
static inline unsigned short get_mask(v16i a)
{
/* If _mm512_movemask_epi32 exists, use it. Otherwise cast to float. */
return (unsigned short)_mm512_movemask_epi32(a);
}
/* Store 16 integers to memory */
static inline void store_epi32(void* addr, v16i a)
{
/* If _mm512_storeu_epi32 exists, use it. Otherwise cast to float store. */
_mm512_storeu_epi32(addr, a);
}
/* -----------------------------------------------------------------------
* §2 Triangle Setup
* ----------------------------------------------------------------------- */
typedef struct {
float x, y, z, w, u, v;
} Vertex;
typedef struct {
/* Edge data (28.4) */
int32_t e01_dx, e01_dy; /* per-pixel steps in 28.4 */
int32_t e12_dx, e12_dy;
int32_t e20_dx, e20_dy;
int32_t e01_row0, e12_row0, e20_row0; /* initial edge values (28.4^2) */
/* Bounding box (pixels) */
int xmin, ymin, xmax, ymax;
/* Perspective-correct UV (float) */
float diw_dx, diw_dy, duw_dx, duw_dy, dvw_dx, dvw_dy;
float iw_row0, uw_row0, vw_row0;
/* Texture */
int tex_w, tex_h, tex_w_mask, tex_h_mask, is_pow2;
/* Framebuffer */
int fb_stride;
uint32_t* fb_base;
} TriSetup;
static int triSetup(const Vertex* v0, const Vertex* v1, const Vertex* v2,
int fb_w, int fb_h, int tex_w, int tex_h,
uint32_t* fb, TriSetup* ts)
{
/* Convert vertices to 28.4 fixed-point */
int32_t v0x = (int32_t)(v0->x * 16.0f);
int32_t v0y = (int32_t)(v0->y * 16.0f);
int32_t v1x = (int32_t)(v1->x * 16.0f);
int32_t v1y = (int32_t)(v1->y * 16.0f);
int32_t v2x = (int32_t)(v2->x * 16.0f);
int32_t v2y = (int32_t)(v2->y * 16.0f);
/* Edge derivatives (per pixel step, in 28.4)
* e_dx = (y0 - y1) * 16 (since v0y = y0*16, v1y = y1*16)
* e_dy = (x1 - x0) * 16
*/
ts->e01_dx = (v0y - v1y) * 16;
ts->e01_dy = (v1x - v0x) * 16;
ts->e12_dx = (v1y - v2y) * 16;
ts->e12_dy = (v2x - v1x) * 16;
ts->e20_dx = (v2y - v0y) * 16;
ts->e20_dy = (v0x - v2x) * 16;
/* Area (64-bit to avoid overflow) — for backface culling */
int64_t area = (int64_t)(v0x - v2x) * (v1y - v2y)
- (int64_t)(v0y - v2y) * (v1x - v2x);
if (area <= 0) return 0; /* backface or degenerate */
/* Bounding box in pixel coordinates */
ts->xmin = (int)fminf(fminf(v0->x, v1->x), v2->x);
if (ts->xmin < 0) ts->xmin = 0;
ts->xmax = (int)fmaxf(fmaxf(v0->x, v1->x), v2->x);
if (ts->xmax >= fb_w) ts->xmax = fb_w - 1;
ts->ymin = (int)fminf(fminf(v0->y, v1->y), v2->y);
if (ts->ymin < 0) ts->ymin = 0;
ts->ymax = (int)fmaxf(fmaxf(v0->y, v1->y), v2->y);
if (ts->ymax >= fb_h) ts->ymax = fb_h - 1;
if (ts->xmin > ts->xmax || ts->ymin > ts->ymax) return 0;
/* Initial edge values at (xmin, ymin) pixel center
* Pixel center in 28.4: (x*16 + 8, y*16 + 8)
* Edge: e = (sy - v0y)*(v1x - v0x) - (sx - v0x)*(v1y - v0y)
*/
int32_t sx = ts->xmin * 16 + 8;
int32_t sy = ts->ymin * 16 + 8;
ts->e01_row0 = (sy - v0y) * (v1x - v0x) - (sx - v0x) * (v1y - v0y);
ts->e12_row0 = (sy - v1y) * (v2x - v1x) - (sx - v1x) * (v2y - v1y);
ts->e20_row0 = (sy - v2y) * (v0x - v2x) - (sx - v2x) * (v0y - v2y);
/* Perspective-correct UV interpolation setup (float) */
float inv_area = 1.0f / (float)(area >> 8); /* area / 256 */
float inv_w0 = 1.0f / v0->w;
float inv_w1 = 1.0f / v1->w;
float inv_w2 = 1.0f / v2->w;
float uw0 = v0->u * inv_w0, uw1 = v1->u * inv_w1, uw2 = v2->u * inv_w2;
float vw0 = v0->v * inv_w0, vw1 = v1->v * inv_w1, vw2 = v2->v * inv_w2;
/* Barycentric gradients in pixel units */
float w0_dx = (float)(v1y - v2y) * inv_area;
float w0_dy = (float)(v2x - v1x) * inv_area;
float w1_dx = (float)(v2y - v0y) * inv_area;
float w1_dy = (float)(v0x - v2x) * inv_area;
float w2_dx = (float)(v0y - v1y) * inv_area;
float w2_dy = (float)(v1x - v0x) * inv_area;
/* Barycentric values at (xmin, ymin) pixel center */
float w0_0 = (float)ts->e12_row0 * inv_area / 256.0f;
float w1_0 = (float)ts->e20_row0 * inv_area / 256.0f;
float w2_0 = (float)ts->e01_row0 * inv_area / 256.0f;
/* Perspective-correct attribute gradients */
ts->diw_dx = w0_dx * inv_w0 + w1_dx * inv_w1 + w2_dx * inv_w2;
ts->diw_dy = w0_dy * inv_w0 + w1_dy * inv_w1 + w2_dy * inv_w2;
ts->duw_dx = w0_dx * uw0 + w1_dx * uw1 + w2_dx * uw2;
ts->duw_dy = w0_dy * uw0 + w1_dy * uw1 + w2_dy * uw2;
ts->dvw_dx = w0_dx * vw0 + w1_dx * vw1 + w2_dx * vw2;
ts->dvw_dy = w0_dy * vw0 + w1_dy * vw1 + w2_dy * vw2;
ts->iw_row0 = w0_0 * inv_w0 + w1_0 * inv_w1 + w2_0 * inv_w2;
ts->uw_row0 = w0_0 * uw0 + w1_0 * uw1 + w2_0 * uw2;
ts->vw_row0 = w0_0 * vw0 + w1_0 * vw1 + w2_0 * vw2;
/* Texture info */
ts->tex_w = tex_w;
ts->tex_h = tex_h;
ts->is_pow2 = ((tex_w & (tex_w - 1)) == 0) && ((tex_h & (tex_h - 1)) == 0);
ts->tex_w_mask = tex_w - 1;
ts->tex_h_mask = tex_h - 1;
ts->fb_stride = fb_w;
ts->fb_base = fb;
return 1;
}
/* -----------------------------------------------------------------------
* §3 Pixel Pipeline (16-wide SIMD)
* ----------------------------------------------------------------------- */
/* Unpack RGBA from packed 32-bit integer */
static inline void unpack_rgba(v16i packed, v16i* r, v16i* g, v16i* b, v16i* a)
{
v16i mask_ff = _mm512_set1_epi32(0xFF);
*r = _mm512_and_epi32(packed, mask_ff);
*g = _mm512_and_epi32(_mm512_srli_epi32(packed, 8), mask_ff);
*b = _mm512_and_epi32(_mm512_srli_epi32(packed, 16), mask_ff);
*a = _mm512_srli_epi32(packed, 24);
}
/* Wrap or clamp texture coordinate */
static inline v16i wrap_coord(v16i coord, int size, int mask, int is_pow2)
{
if (is_pow2) {
return _mm512_and_epi32(coord, _mm512_set1_epi32(mask));
} else {
/* Clamp to [0, size-1] for non-power-of-two textures */
v16i zero = _mm512_setzero_epi32();
v16i max = _mm512_set1_epi32(size - 1);
return _mm512_min_epi32(_mm512_max_epi32(coord, zero), max);
}
}
/* Shade 16 pixels (8x2 tile) */
static void shadePixels16(
const TriSetup* ts, const uint32_t* texture,
v16i dx_pix, v16i dy_pix, v16i px_i, v16i py_i, unsigned short mask)
{
/* ---- Perspective interpolation (float) ---- */
v16f dx_f = _mm512_cvtepi32_ps(dx_pix);
v16f dy_f = _mm512_cvtepi32_ps(dy_pix);
v16f iw = _mm512_add_ps(
_mm512_add_ps(_mm512_set1_ps(ts->iw_row0),
_mm512_mul_ps(_mm512_set1_ps(ts->diw_dx), dx_f)),
_mm512_mul_ps(_mm512_set1_ps(ts->diw_dy), dy_f));
v16f uw = _mm512_add_ps(
_mm512_add_ps(_mm512_set1_ps(ts->uw_row0),
_mm512_mul_ps(_mm512_set1_ps(ts->duw_dx), dx_f)),
_mm512_mul_ps(_mm512_set1_ps(ts->duw_dy), dy_f));
v16f vw = _mm512_add_ps(
_mm512_add_ps(_mm512_set1_ps(ts->vw_row0),
_mm512_mul_ps(_mm512_set1_ps(ts->dvw_dx), dx_f)),
_mm512_mul_ps(_mm512_set1_ps(ts->dvw_dy), dy_f));
/* Perspective divide (Newton-Raphson refinement) */
v16f rcp_iw = _mm512_rcp_ps(iw);
rcp_iw = _mm512_mul_ps(rcp_iw,
_mm512_sub_ps(_mm512_set1_ps(2.0f),
_mm512_mul_ps(iw, rcp_iw)));
v16f u = _mm512_mul_ps(uw, rcp_iw);
v16f v = _mm512_mul_ps(vw, rcp_iw);
/* ---- Texel coordinates ---- */
v16f fu = _mm512_mul_ps(u, _mm512_set1_ps((float)ts->tex_w));
v16f fv = _mm512_mul_ps(v, _mm512_set1_ps((float)ts->tex_h));
v16i iu = _mm512_cvttps_epi32(fu);
v16i iv = _mm512_cvttps_epi32(fv);
v16f frac_u = _mm512_sub_ps(fu, _mm512_cvtepi32_ps(iu));
v16f frac_v = _mm512_sub_ps(fv, _mm512_cvtepi32_ps(iv));
/* ---- Bilinear tap coordinates ---- */
v16i iu0 = wrap_coord(iu, ts->tex_w, ts->tex_w_mask, ts->is_pow2);
v16i iv0 = wrap_coord(iv, ts->tex_h, ts->tex_h_mask, ts->is_pow2);
v16i iu1 = wrap_coord(_mm512_add_epi32(iu0, _mm512_set1_epi32(1)),
ts->tex_w, ts->tex_w_mask, ts->is_pow2);
v16i iv1 = wrap_coord(_mm512_add_epi32(iv0, _mm512_set1_epi32(1)),
ts->tex_h, ts->tex_h_mask, ts->is_pow2);
/* ---- Linear addresses: addr = y * width + x ---- */
v16i stride = _mm512_set1_epi32(ts->tex_w);
v16i addr00 = _mm512_add_epi32(_mm512_mullo_epi32(iv0, stride), iu0);
v16i addr10 = _mm512_add_epi32(_mm512_mullo_epi32(iv0, stride), iu1);
v16i addr01 = _mm512_add_epi32(_mm512_mullo_epi32(iv1, stride), iu0);
v16i addr11 = _mm512_add_epi32(_mm512_mullo_epi32(iv1, stride), iu1);
/* ---- Gather 4 texels (raw RGBA as 32-bit integers) ---- */
v16i c00 = gather_epi32(texture, addr00, mask);
v16i c10 = gather_epi32(texture, addr10, mask);
v16i c01 = gather_epi32(texture, addr01, mask);
v16i c11 = gather_epi32(texture, addr11, mask);
/* ---- Unpack RGBA channels ---- */
v16i r00, g00, b00, a00, r10, g10, b10, a10;
v16i r01, g01, b01, a01, r11, g11, b11, a11;
unpack_rgba(c00, &r00, &g00, &b00, &a00);
unpack_rgba(c10, &r10, &g10, &b10, &a10);
unpack_rgba(c01, &r01, &g01, &b01, &a01);
unpack_rgba(c11, &r11, &g11, &b11, &a11);
/* ---- Bilinear weights ---- */
v16f w0 = _mm512_mul_ps(
_mm512_sub_ps(_mm512_set1_ps(1.0f), frac_u),
_mm512_sub_ps(_mm512_set1_ps(1.0f), frac_v));
v16f w1 = _mm512_mul_ps(
frac_u,
_mm512_sub_ps(_mm512_set1_ps(1.0f), frac_v));
v16f w2 = _mm512_mul_ps(
_mm512_sub_ps(_mm512_set1_ps(1.0f), frac_u),
frac_v);
v16f w3 = _mm512_mul_ps(frac_u, frac_v);
/* ---- Blend channels ---- */
v16f r = _mm512_add_ps(
_mm512_add_ps(_mm512_mul_ps(w0, _mm512_cvtepi32_ps(r00)),
_mm512_mul_ps(w1, _mm512_cvtepi32_ps(r10))),
_mm512_add_ps(_mm512_mul_ps(w2, _mm512_cvtepi32_ps(r01)),
_mm512_mul_ps(w3, _mm512_cvtepi32_ps(r11))));
v16f g = _mm512_add_ps(
_mm512_add_ps(_mm512_mul_ps(w0, _mm512_cvtepi32_ps(g00)),
_mm512_mul_ps(w1, _mm512_cvtepi32_ps(g10))),
_mm512_add_ps(_mm512_mul_ps(w2, _mm512_cvtepi32_ps(g01)),
_mm512_mul_ps(w3, _mm512_cvtepi32_ps(g11))));
v16f b = _mm512_add_ps(
_mm512_add_ps(_mm512_mul_ps(w0, _mm512_cvtepi32_ps(b00)),
_mm512_mul_ps(w1, _mm512_cvtepi32_ps(b10))),
_mm512_add_ps(_mm512_mul_ps(w2, _mm512_cvtepi32_ps(b01)),
_mm512_mul_ps(w3, _mm512_cvtepi32_ps(b11))));
v16f a = _mm512_add_ps(
_mm512_add_ps(_mm512_mul_ps(w0, _mm512_cvtepi32_ps(a00)),
_mm512_mul_ps(w1, _mm512_cvtepi32_ps(a10))),
_mm512_add_ps(_mm512_mul_ps(w2, _mm512_cvtepi32_ps(a01)),
_mm512_mul_ps(w3, _mm512_cvtepi32_ps(a11))));
/* ---- Pack to uint32_t ---- */
v16i ir = _mm512_cvtps_epi32(r);
v16i ig = _mm512_slli_epi32(_mm512_cvtps_epi32(g), 8);
v16i ib = _mm512_slli_epi32(_mm512_cvtps_epi32(b), 16);
v16i ia = _mm512_slli_epi32(_mm512_cvtps_epi32(a), 24);
v16i packed = _mm512_or_epi32(
_mm512_or_epi32(ir, ig),
_mm512_or_epi32(ib, ia));
/* ---- Framebuffer write (scalar fallback for safety) ---- */
int32_t px[16], py[16], col[16];
store_epi32(px, px_i);
store_epi32(py, py_i);
store_epi32(col, packed);
unsigned short mask_row0 = mask & 0x00FF;
unsigned short mask_row1 = (mask >> 8) & 0x00FF;
/* Row 0 (lanes 0-7) */
if (mask_row0) {
uint32_t* fb0 = ts->fb_base + py[0] * ts->fb_stride + px[0];
for (int i = 0; i < 8; i++) {
if (mask_row0 & (1 << i)) {
fb0 = (uint32_t)col;
}
}
}
/* Row 1 (lanes 8-15) */
if (mask_row1) {
uint32_t* fb1 = ts->fb_base + py[8] * ts->fb_stride + px[8];
for (int i = 0; i < 8; i++) {
if (mask_row1 & (1 << i)) {
fb1 = (uint32_t)col[i + 8];
}
}
}
}
/* -----------------------------------------------------------------------
* §4 Tile Driver (8x2 pixel tiles)
* ----------------------------------------------------------------------- */
static void rasterizeTile16(const TriSetup* ts, const uint32_t* texture,
int tx, int ty)
{
int y0 = ty;
int y1 = ty + 1;
/* Early reject if tile is entirely outside triangle */
if (y0 > ts->ymax || y1 > ts->ymax || y0 < ts->ymin) return;
/* Build pixel coordinate vectors:
* px = [tx, tx+1, ..., tx+7, tx, tx+1, ..., tx+7]
* py = [y0, y0, ..., y0, y1, y1, ..., y1]
*/
int32_t px_arr[16], py_arr[16];
for (int i = 0; i < 8; i++) {
px_arr = tx + i;
px_arr[i + 8] = tx + i;
py_arr = y0;
py_arr[i + 8] = y1;
}
v16i px_i = _mm512_loadu_epi32(px_arr);
v16i py_i = _mm512_loadu_epi32(py_arr);
/* Offsets from bounding box origin (in pixels) */
v16i xmin_i = _mm512_set1_epi32(ts->xmin);
v16i ymin_i = _mm512_set1_epi32(ts->ymin);
v16i dx_pix = _mm512_sub_epi32(px_i, xmin_i);
v16i dy_pix = _mm512_sub_epi32(py_i, ymin_i);
/* ---- Edge evaluation (28.4 fixed-point) ----
* e = e_row0 + e_dx * dx_pix + e_dy * dy_pix
* All values in 28.4^2 units; sign determines coverage.
*/
v16i e01 = _mm512_add_epi32(
_mm512_set1_epi32(ts->e01_row0),
_mm512_add_epi32(
_mm512_mullo_epi32(_mm512_set1_epi32(ts->e01_dx), dx_pix),
_mm512_mullo_epi32(_mm512_set1_epi32(ts->e01_dy), dy_pix)));
v16i e12 = _mm512_add_epi32(
_mm512_set1_epi32(ts->e12_row0),
_mm512_add_epi32(
_mm512_mullo_epi32(_mm512_set1_epi32(ts->e12_dx), dx_pix),
_mm512_mullo_epi32(_mm512_set1_epi32(ts->e12_dy), dy_pix)));
v16i e20 = _mm512_add_epi32(
_mm512_set1_epi32(ts->e20_row0),
_mm512_add_epi32(
_mm512_mullo_epi32(_mm512_set1_epi32(ts->e20_dx), dx_pix),
_mm512_mullo_epi32(_mm512_set1_epi32(ts->e20_dy), dy_pix)));
/* ---- Coverage mask (all edges >= 0) ---- */
v16i zero = _mm512_setzero_epi32();
v16i inside = _mm512_and_epi32(
_mm512_and_epi32(
_mm512_cmpge_epi32(e01, zero),
_mm512_cmpge_epi32(e12, zero)),
_mm512_cmpge_epi32(e20, zero));
unsigned short mask = get_mask(inside);
if (mask == 0) return;
/* ---- Clamp pixel coordinates to screen bounds ---- */
v16i fb_w_max = _mm512_set1_epi32(ts->fb_stride - 1);
v16i ymax_i = _mm512_set1_epi32(ts->ymax);
px_i = _mm512_max_epi32(_mm512_min_epi32(px_i, fb_w_max), zero);
py_i = _mm512_max_epi32(_mm512_min_epi32(py_i, ymax_i), zero);
/* ---- Shade covered pixels ---- */
shadePixels16(ts, texture, dx_pix, dy_pix, px_i, py_i, mask);
}
/* -----------------------------------------------------------------------
* §5 Entry Point
* ----------------------------------------------------------------------- */
void rasterizeTriangle(const Vertex* v0, const Vertex* v1, const Vertex* v2,
uint32_t* fb, int fb_w, int fb_h,
const uint32_t* tex, int tex_w, int tex_h)
{
TriSetup ts;
if (!triSetup(v0, v1, v2, fb_w, fb_h, tex_w, tex_h, fb, &ts))
return;
/* Walk 8x2 tiles aligned to bounding box */
int tx0 = ts.xmin & ~7;
int ty0 = ts.ymin & ~1;
int tx1 = (ts.xmax + 7) & ~7;
int ty1 = (ts.ymax + 1) & ~1;
for (int ty = ty0; ty < ty1; ty += 2) {
for (int tx = tx0; tx < tx1; tx += 8) {
rasterizeTile16(&ts, tex, tx, ty);
}
}
}
```
## Summary of corrections applied
| Issue | Previous version | This version |
|-------|-----------------|--------------|
| Edge derivatives | `e_dx = (v0y - v1y)` (missing ×16) | `e_dx = (v0y - v1y) * 16` (correct per-pixel step) |
| Initial edge value | Mixed 28.4 and pixel units | Pure 28.4: `(sy - v0y)*(v1x - v0x) - (sx - v0x)*(v1y - v0y)` |
| Gather return type | Float with reinterpret cast | Integer gather `_mm512_mask_i32gather_epi32` |
| Framebuffer store | Two 128-bit stores (AVX-512F) | Scalar fallback (safe, verifiable) |
| Texture modulo | `_mm512_rem_epi32` (fantasy) | Power-of-two AND; non-pow2 clamp |
| Intrinsic naming | Mixed `_si512` and `_epi32` | Consistent `_epi32` suffix |
| Overflow handling | 32-bit area | 64-bit area in setup |
## Remaining work (requires actual ICC 12.x)
1. **Verify every intrinsic name** against `zmmintrin.h`
2. **Test edge rule** (top-left fill convention, shared edge handling)
3. **Benchmark scalar framebuffer store** vs masked store (if `_mm512_mask_storeu_epi32` exists)
4. **Test overflow behavior** for large triangles on high-res framebuffers
5. **Add sub-pixel precision** for vertex positions (currently truncates, should round)
The architecture is now correct. The implementation is as close to production-ready as possible without access to the actual compiler and hardware.