Skip to content

Build Plan ​

A step-by-step plan for building the foundation of Gamma. It is written so an agent can pick up the next unchecked step and finish it without further context. The design it implements is in docs.md.

How to work through this plan ​

  1. Read AGENTS.md and contributing.md first. Their rules apply to every step.
  2. Take the first unchecked step. Do not start a step whose earlier steps are unchecked.
  3. Do only what the step lists. If something outside the step looks necessary, add it to "Open questions" at the bottom instead of building it. Work the user asks for outside the plan is fine; list it under "Work outside the plan" so later steps know it exists.
  4. A step is finished when every item under "Done when" is true and the checks below pass. Then tick its checkbox in this file and commit, using the commit title given for the step.
  5. One step is one commit, or one small pull request. Never combine steps. A step that says it may be several commits is still one step.
  6. Stop and ask the user when a step needs a decision this plan does not make, when a library does not behave as the step assumes, or when a "Done when" item cannot be met. An open question marked "Ask the user" must be answered before its step starts.
  7. Check a library's current documentation before using its API. Do not write calls from memory for Luau, SDL3, bgfx, Dear ImGui, luau-lsp or vcpkg ports. Check that a vcpkg port exists at the pinned baseline, and which features it has, before planning around it.
  8. Before starting a step, read the open questions that name it and the "Work outside the plan" list. Earlier work may already cover part of the step, or change how it should be done.

Checks for every step ​

These are what CI runs, so a step that skips them fails its pull request.

  • cmake --build --preset debug and ctest --preset debug pass.
  • clang-format --dry-run --Werror passes on the changed C++ files (CI pins clang-format 23.1.5).
  • stylua --check . and selene . pass.
  • Every feature exposed to Luau has a *.spec.luau file as well as its C++ tests (from step 9 on).
  • New user-facing behaviour is documented in DOCS/ when a step says so, or when it changes something already documented there, such as projects.md.

Layout ​

All steps use this layout. Create a folder only when the step that needs it arrives.

CMakeLists.txt
CMakePresets.json
vcpkg.json
rokit.toml
gamma.yml        selene std for Gamma's globals
Source/
  Core/          signals, logging, shared utilities
  Instances/     Instance, reflection, Variant, DataModel and the instance classes
    Services/    RunService, LogService and the other services
  DataTypes/     Vector3, CFrame, Color3, UDim2, Enum and the other value types
  Scripting/     Luau VM, scheduler, require, definitions, project loading
    Bindings/    Luau bindings for instances and datatypes
  Rendering/     window, bgfx, scene and UI drawing
  Ui/            UI nodes, styles and layout (from step 21)
  Runtime/       the Gamma executable (main)
Tests/           doctest tests, one file per system
  Luau/          Luau specs (*.spec.luau), the Test.luau helper and fixtures
  Projects/      project folders, each run by ctest through Gamma run
DOCS/            design, contributing rules, this plan and one page per user-facing system
Assets/          files compiled into the engine, such as the default fonts and their licence
cmake/           CMake scripts the build runs

Everything except Runtime/ builds into one static library, GammaEngine. Runtime/ builds the Gamma executable and Tests/ builds GammaTests, both linking GammaEngine. Each Tests/Luau/*.spec.luau and each Tests/Projects/* folder is its own CTest entry.

Phase 0: Tooling ​

[x] Step 0: Check the machine ​

State on 2026-11-12 (Windows 11): CMake 4.4, Ninja, Rokit, StyLua, Selene and gh are installed. vcpkg, clang-format and a C++ compiler were not found on PATH, and VCPKG_ROOT is not set.

  • Check for Visual Studio 2022 Build Tools with the C++ workload (vswhere). MSVC is normally absent from PATH outside a developer shell, so a missing cl does not prove it is missing.
  • Check for vcpkg and clang-format again.
  • Do not install anything yourself. Report what is missing to the user with the install command for each, and wait.

Done when: a C++20 compiler, vcpkg (with VCPKG_ROOT set) and clang-format are all available. No commit.

[x] Step 1: Build skeleton ​

  • CMakeLists.txt: C++20, warnings on, the GammaEngine, Gamma and GammaTests targets, enable_testing() and doctest test discovery.
  • CMakePresets.json: one Ninja preset each for debug and release, using the vcpkg toolchain file from VCPKG_ROOT.
  • vcpkg.json: manifest mode with a pinned builtin-baseline. The only dependency is doctest.
  • .clang-format matching the naming rules in AGENTS.md, and a .gitignore covering build/ and vcpkg output.
  • Source/Runtime/Main.cpp that prints the version and exits, and Tests/Main.cpp with one trivial passing test.

Done when: configure, build and ctest succeed from a clean checkout, and Gamma runs. Commit: [CHORE] Add CMake and vcpkg build skeleton

[x] Step 2: Luau tooling and real commands ​

  • rokit.toml pinning luau-lsp, StyLua and Selene. Add stylua.toml, selene.toml and a .luaurc.
  • Replace the planned commands in the "Commands" section of AGENTS.md with the real ones from step 1, and remove the note saying the build is not set up.

Done when: rokit install, stylua --check . and selene . run cleanly. Commit: [CHORE] Add Luau tooling configuration

[x] Step 3: Continuous integration ​

  • A GitHub Actions workflow that configures, builds and tests on Windows and Linux, with vcpkg binary caching.
  • A second job that runs clang-format --dry-run --Werror, stylua --check and selene.

Done when: both jobs pass on a pull request. Commit: [CHORE] Add build and lint workflows

Phase 1: Instance system ​

No Luau in this phase. Everything is plain C++ and tested with doctest.

[x] Step 4: Signal ​

  • Source/Core/Signal.h: a typed signal with Connect, Once, Disconnect on the returned connection, and Fire.
  • Disconnecting or connecting from inside a handler while the signal is firing must be safe.

Done when: tests cover firing order, disconnect during fire, connect during fire and Once. Commit: [MINOR] Add Signal

[x] Step 5: Instance tree ​

  • Instance with Name, ClassName, Parent, GetChildren, GetDescendants, FindFirstChild, FindFirstChildOfClass, IsA, IsDescendantOf, GetFullName, Destroy and ClearAllChildren.
  • Signals: ChildAdded, ChildRemoved, DescendantAdded, DescendantRemoving, AncestryChanged, Destroying.
  • Ownership: a parent holds its children with std::shared_ptr and a child holds its parent weakly. Record this choice in a short comment at the class.
  • Reject a parent change that would create a cycle. Destroy locks Parent, disconnects all signals and destroys the descendants.

Done when: tests cover reparenting, cycle rejection, event order and every Destroy rule above. Commit: [MAJOR] Add Instance tree

[x] Step 6: Reflection ​

  • A class registry holding, for each class: its name, its superclass, a factory, and descriptors for its properties, methods and events.
  • A Variant type for property values. Start with nil, bool, number, string and Instance reference. Later steps add to it.
  • Instance::GetProperty and SetProperty by name, Changed and GetPropertyChangedSignal, and a CreateInstance(ClassName) function.
  • Register Instance itself and a Folder class through the registry, as the proof that it works.

Done when: tests create a Folder by name, read and write Name through the generic property path, and see Changed fire once per actual change. Commit: [MAJOR] Add class registry and property reflection

[x] Step 7: DataModel and services ​

  • DataModel with GetService and FindService. A service is created on first request and exists once.
  • Empty Workspace, ReplicatedStorage, ServerScriptService and RunService classes. RunService gets Heartbeat and Stepped signals and a Step(DeltaTime) function that fires them.
  • Services cannot be created with CreateInstance, reparented or destroyed.

Done when: tests cover the service lifetime rules and Heartbeat firing with the given delta time. Commit: [MAJOR] Add DataModel and core services

Phase 2: Luau ​

[x] Step 8: Embed Luau ​

  • Add Luau to the build. Use the vcpkg port if it provides the VM, compiler, analysis and require targets. Otherwise use FetchContent pinned to a release tag. Check which is true before choosing, and write the result in "Open questions".
  • Source/Scripting/ScriptEngine: create a state, compile and run a source string, report compile and runtime errors with a traceback, enable the sandbox (luaL_sandbox), and send print and warn to a replaceable output callback.
  • Gamma run <File.luau> runs a file and exits with a non-zero code on error.

Done when: tests run a script, capture its print output, and get a readable error for both a syntax error and a runtime error. Commit: [MAJOR] Embed Luau

[x] Step 9: Luau test runner ​

  • A small Luau test helper in Tests/Luau/ with expect style assertions, and a CTest entry that runs every *.spec.luau file through Gamma run.
  • From this step on, every feature exposed to Luau gets a spec file as well as its C++ tests.

Done when: one passing spec runs under ctest, and a deliberately failing spec makes ctest fail (then remove it). Commit: [CHORE] Add Luau spec runner

[x] Step 10: Instance bindings ​

  • Push an Instance to Luau as userdata. The same instance must always give the same userdata, so == and table keys work. A userdata keeps its instance alive.
  • __index and __newindex driven entirely by the registry from step 6: properties first, then methods, then events, then children by name. No per-class binding code.
  • Signals as objects with Connect, Once and Wait, returning a connection with Disconnect and Connected.
  • Globals: Instance.new(ClassName, Parent?), game, workspace, and typeof returning "Instance".
  • Errors use Roblox's wording where practical (X is not a valid member of Folder "Y"), since packages match on it.

Done when: specs build a tree from Luau, connect to ChildAdded, call game:GetService("Workspace"), and check the identity and error rules above. Commit: [MAJOR] Bind instances to Luau

[x] Step 11: Task scheduler ​

  • The task library: spawn, defer, delay, wait, cancel. Plus the legacy wait and spawn globals.
  • The scheduler resumes waiting threads from RunService:Step. Signal handlers run in their own coroutine so a handler can yield.
  • Gamma run keeps stepping at 60 Hz until no threads are waiting and no connections are left that could wake one, then exits.

Done when: specs cover resume order for spawn and defer, task.wait returning elapsed time, task.cancel, and yielding inside a Heartbeat handler. Commit: [MAJOR] Add task scheduler

[x] Step 12: Datatypes ​

  • Add GLM. Implement Vector3, Vector2, Color3, UDim, UDim2 and CFrame with their Roblox constructors, operators, methods and constants.
  • Decide whether Vector3 uses Luau's native vector type, and record the decision in "Open questions". It is faster, but check how typeof and the Vector3 library table would work first.
  • Enum with the Enum.X.Y access pattern and EnumItem values, generated from the registry.
  • Add each type to Variant. One commit per type or closely related pair; this step may be several commits.

Done when: specs for each type compare against values taken from Roblox's documented behaviour, including CFrame multiplication and Lerp. Commit: [MINOR] Add <Type> datatype

[x] Step 13: Scripts and require ​

  • Script, LocalScript and ModuleScript classes with a Source property. A Script runs when it enters the DataModel under a container that runs scripts. Each script gets its own script global.
  • require(ModuleScript) runs a module once and caches the result. require("./Path") and .luaurc aliases use Luau's require library.
  • Gamma run <Folder> loads a folder as a project: a small mapping from files to instances (Name.server.luau, Name.client.luau, Name.luau, init.luau). Keep the mapping minimal and document it in DOCS/.

Done when: specs cover module caching, a cyclic require error, path and alias requires, and a project folder with a script that requires a module. Commit: [MAJOR] Add script instances and require

[x] Step 14: Package check ​

  • Vendor two pure-logic Roblox packages into Tests/Packages/, a Signal and a Promise implementation, with their licences.
  • Write a spec that uses each one. Fix what breaks in Gamma, not in the package. List anything that cannot be fixed yet in "Open questions".

Done when: both specs pass with the packages unmodified. Commit: [CHORE] Add package compatibility specs

Phase 2b: Hardening ​

Small steps that make the next phases safer to build. They change no engine behaviour.

[x] Step 14a: Sanitizer build ​

  • An asan configure, build and test preset that builds debug with AddressSanitizer and UndefinedBehaviorSanitizer on GCC and Clang. MSVC only supports AddressSanitizer; leave the preset Linux-only unless it works there unchanged.
  • A Linux CI job that builds and runs ctest with that preset. Leak detection stays on: an instance tree that is never freed is a bug here (see the ObjectValue and reparenting-test fixes).

Done when: the job passes on a pull request, and a deliberately leaked Instance in a test makes it fail (then remove it). Commit: [CHORE] Add sanitizer preset and CI job

[x] Step 14b: Luau definitions from the registry ​

  • Gamma definitions <Directory> writes a luau-lsp definitions file and a selene std file generated from the class registry, the enums and the datatype bindings, so they cannot drift from the engine.
  • Replace the hand-written gamma.yml with the generated std, and point .luaurc or the luau-lsp settings at the definitions file. Commit the generated files.
  • A CI step regenerates both and fails if they differ from the committed ones.
  • Check the luau-lsp definitions format and its analyze command against its current documentation first.

Done when: selene . passes with the generated std, luau-lsp analyze reports no unknown-global or unknown-member errors in Tests/Luau/ (the vendored packages may be excluded), and the CI check fails after a registry change that was not regenerated. Commit: [MINOR] Generate Luau definitions from the registry

Phase 3: Window and rendering ​

[x] Step 15: Window and input ​

  • Add SDL3. Gamma play <Folder> opens a window, runs the project, steps RunService every frame and closes cleanly. Gamma run stays headless and never initialises SDL's video subsystem.
  • UserInputService with InputBegan, InputEnded, InputChanged and IsKeyDown, and an InputObject class carrying KeyCode, UserInputType, UserInputState, Position and Delta. Add the KeyCode, UserInputType and UserInputState enums.
  • Keep the SDL translation in Rendering/ and give UserInputService an engine-side entry point that takes Gamma's own input event, so tests can feed it without SDL or a display.
  • Before starting, answer the step 15 question in "Open questions" about LocalScript and RunService:IsClient().

Done when: doctest and a spec drive UserInputService through the engine-side entry point and see the right events, IsKeyDown state and gameProcessedEvent argument (always false until there is game UI); a manual project under Tests/Manual/ prints key presses in Gamma play (not run by ctest); and the headless tests still pass on CI with no display. Commit: [MAJOR] Add window and input

[x] Step 16: Renderer ​

  • Add bgfx. Check first that the vcpkg port at the baseline builds shaderc (its tools feature) and works with SDL3's native window handles; if not, stop and ask.
  • Initialise bgfx on the SDL window, handle resize, and clear the screen. Compile shaders in the build with shaderc.
  • BasePart with Size, CFrame, Position (derived from CFrame), Color, Transparency and Anchored, and Part under it. Camera with CFrame and FieldOfView. Workspace.CurrentCamera is created with the Workspace and is a reference property.
  • Draw every BasePart under Workspace as a box with simple directional lighting. Add RunService.RenderStepped, which fires only in Gamma play, before drawing, so Gamma run exit rules do not change.
  • Gamma play <Folder> --screenshot <File.png> --frames <N> renders N frames, saves the last one and exits, so the result can be checked without a person watching.

Done when: a project under Tests/Manual/ that spawns parts and moves the camera on RenderStepped shows the expected scene, the --screenshot output is attached to the pull request, and Part and Camera properties have doctests and specs that run headless. Commit: [MAJOR] Add bgfx renderer with Part and Camera

Phase 4: Editor and saving ​

[x] Step 17: Place files ​

  • A readable JSON format that stores a tree with class names, properties, attributes, tags and instance references, written with stable ordering (properties and attributes by name, children in tree order) so diffs stay small.
  • Write numbers with the shortest form that reads back to the same double (std::to_chars), and every Variant type (Vector3, CFrame, Color3, UDim2, EnumItem, NumberRange and the rest) in a fixed shape, so output is byte-identical on every platform.
  • Reuse Source/Instances/Json for reading and writing, moving it to Core/ if needed. Add simdjson only if loading a large place is measurably slow, and record that in "Open questions".
  • Save and load through the registry only. A property marked as not serialised is skipped, and an instance with Archivable false is not saved, as in Roblox. A reference to an instance outside the saved tree is saved as nil. References use ids local to the file, as Clone rewrites them.
  • Gamma run <Place.json> loads a place and runs it like a project folder.
  • Document the format in DOCS/.

Done when: a round-trip test saves, loads and saves a tree again and gets byte-identical output; tests cover every Variant type, a reference inside and outside the tree, a non-archivable instance and a skipped property; and a spec runs a place file through Gamma run. Commit: [MAJOR] Add text place files

Notes: built before steps 14b, 15 and 16, at the user's request to keep adding features (step 15 and 16 cannot be built in this container). The format is documented in places.md. Only properties that differ from a new instance of the class are written, which keeps files small; a changed engine default therefore changes what an old place loads as. PropertyDescriptor::Serialized marks a property place files skip; Archivable is the first, since only archivable instances are saved. Every Variant type has a written form, but TweenInfo, Ray, DateTime and the two keypoint types are tested only through their code, since no property or attribute holds them yet. The C++ tests ran here through a stand-in for doctest; the Gamma run place test (Tests/Places/Basic.json) could not be run here.

[x] Step 18: Editor shell ​

  • Add Dear ImGui (docking branch) with its SDL3 and bgfx backends. Check that the vcpkg imgui port offers the docking branch and both backends at the baseline before starting. Gamma edit <Place> opens the editor.
  • Panels: Viewport (the scene rendered to a texture, with a fly camera), Explorer (tree, select, rename, delete, insert from the registry's creatable classes), Properties (generated from the registry, with enum properties as dropdowns) and Output (listening to LogService.MessageOut, coloured by MessageType).
  • Keep each editor operation (insert, rename, delete, set property, select) as a function on the engine side, separate from the ImGui drawing, so it can be tested with doctest. Store the selection in a Selection service, as Roblox does, so later plugins can read it.
  • Save and open through step 17. One commit per panel.

Done when: a place can be opened, edited through Explorer and Properties, saved and reopened with the changes intact; and doctests cover each editor operation and that a save after open with no edits writes the same bytes. Commit: [MAJOR] Add editor shell then [MINOR] Add <Panel> panel

[x] Step 19: Play mode ​

  • Play copies the edited DataModel, runs scripts in the copy and shows it in the viewport. Stop discards the copy and returns to the edited tree.
  • Copy by saving the edited DataModel to the step 17 format in memory and loading it into a new DataModel. Services cannot be cloned, and this keeps one copy path.
  • Closing a DataModel must be defined first (see the step 7 question): stop every script, cancel its threads, delayed callbacks, tweens and Debris items, disconnect handlers, and free the tree. Each DataModel has its own ScriptEngine and scheduler.
  • During play, RunService:IsRunning() is true in the copy and IsEdit() is false; in the edited tree IsEdit() is true. Update the step 11 answer that says Gamma always answers as a running server.

Done when: changes made by scripts during play are gone after stop, edits made before play are still there, a script left yielding or a tween left playing at stop does not run again, and ten play and stop cycles in a test free every instance (checked by the step 14a sanitizer job). Commit: [MAJOR] Add play mode

Direction change (15 Nov 2026) ​

Phases 0 to 4 built a Roblox-style game engine. At the user's request Gamma is now a general-purpose engine for apps, tools, UIs and games, with no built-in editor and a clean break from Roblox compatibility. The reasons and what stays are in docs.md, and the new UI system is designed in ui.md. Steps 18 and 19 (the editor) are undone by step 20. Everything checked above stays as history; later steps change or remove some of it, and say so.

The phases below replace the old "Later" list. The items on it that still apply (physics, audio, glTF, the binary format, hot reloading, the Luau debugger, standalone export, opt-in networking) come after phase 9 and are not planned in detail yet. Undo/redo, gizmos and the command bar were editor features and are dropped.

Phase 5: Remove the editor ​

[x] Step 20: Remove the editor ​

  • Move Source/Editor/ImGuiRenderer to Source/Rendering/: the old Roblox-style GUI (Rendering/GuiOverlay) still draws through it until step 27.
  • Delete the rest of Source/Editor/ (the editor, its operations and state, PlaySession and the panels), the Gamma edit command, the editor tests (Tests/EditorOperations.cpp, Tests/PlaySession.cpp) and DOCS/editor.md. Core/Profiler stays for Gamma play --profile.
  • Remove the Selection service and its spec, which only the editor used. RunService's edit/studio answers go in phase 9 with the rest of the Roblox names.
  • Drop the imgui docking-experimental feature from vcpkg.json, and regenerate the definitions.

Done when: the build, tests and lint pass without Source/Editor/, and nothing in DOCS/ describes the editor as current. Commit: [MAJOR] Remove the editor

Phase 6: UI foundation ​

Builds the node tree, style properties and layout of ui.md next to the old GUI, without drawing yet. Everything is testable headless.

[x] Step 21: UI nodes and flex layout ​

  • Add yoga to vcpkg.json (port 3.2.2 at the baseline).
  • Source/Ui/: UiNode (base of every UI node), View and Surface, registered through the class registry so properties, Changed and the Luau bindings work as for every other class.
  • A Length value holding a number and a unit (Px, Percent, Auto, None). Luau sets length properties with strings ("12px", "50%", "auto", "none") or plain numbers of pixels, and reads them back as strings, so no new Luau datatype is needed. The box shorthands (Margin, Padding, BorderWidth, Inset, Gap) take CSS's one to four values.
  • Layout properties with CSS names and meaning: Display, Position, Width, Height, the min and max sizes, Margin, Padding, BorderWidth, Inset sides, FlexDirection, FlexWrap, JustifyContent, AlignItems, AlignSelf, AlignContent, FlexGrow, FlexShrink, FlexBasis, Gap, AspectRatio. FlexDirection defaults to Column and BoxSizing is always border-box, as in React Native.
  • Surface:Layout(width, height) syncs a Yoga tree with the UI nodes (only for nodes whose layout inputs changed) and writes each node's read-only LayoutRect, relative to the surface. LayoutChanged fires when a node's rect changes.
  • A Ui global with constructors that take a props table: Ui.View({ Width = "50%", Children = { ... } }), setting properties and parenting children, and Ui.new(className).

Done when: doctests cover row and column, grow and shrink, percent sizes, padding with gap, wrap, absolute insets, Display = None and that an unchanged tree is not laid out again; a spec builds a tree with the constructors and checks LayoutRect; definitions are regenerated. Commit: [MAJOR] Add UI nodes and flex layout

Notes: the Text node moved to step 24, since a text node needs measurement to take part in layout. Display, PositionType, FlexDirection, FlexWrap, Justify and Align are registered enums whose items also accept their names as strings. The Position property takes PositionType. AspectRatio 0 means none. Positions in LayoutRect are relative to the surface; a Surface inside another UI tree is skipped by its parent's layout. Yoga's children are synced with the tree lazily, at the start of each Surface:Layout.

[x] Step 22: More lengths and grid ​

  • Lengths em, rem, vw, vh, fr and sums such as "100% - 24px" (resolved before Yoga sees them).
  • Display = Grid: GridTemplateColumns/Rows with fr, minmax(), repeat() and auto-fill, GridColumn/GridRow placement, gaps and auto-placement, laid out by Gamma and handed to Yoga as absolute children.

Done when: doctests cover each unit and the grid cases above; specs cover grid from Luau. Commit: [MINOR] Add relative lengths and length sums then [MINOR] Add grid layout

Notes: FontSize was added here, ahead of step 24, because em needs it; it defaults to "1em", which inherits. Lengths now reach Yoga during Surface:Layout rather than when set. A sum of a percentage and other units is resolved against the parent's content box from the previous pass, and a grid measures its items over three passes (widths with no width set, heights at their column's width, then stretched to their cells), so Layout repeats passes until nothing changes, at most 12. Track sizing is a simplified form of CSS's: content sizes come from those measurements, spanning items spread extra size evenly over their auto tracks, and auto tracks stretch when there are no fr tracks. Named areas, JustifyItems/JustifySelf, column-first flow and dense packing are not built. Display items no longer match Yoga's numbering, since Grid is 2.

Phase 7: UI rendering and text ​

[x] Step 23: UI renderer ​

  • Rendering/UiRenderer: one batched bgfx pass that draws signed-distance rounded rects with fill colour, per-corner BorderRadius and per-side solid borders, in tree order with ZIndex and stacking contexts, clipped by Overflow = Hidden.
  • Paint properties: Background (colours in #hex, rgb(), hsl() and Color3), BorderColor, BorderRadius, Opacity, ZIndex, Overflow.
  • Gamma play draws every Surface whose Target is the window (and Overlay over the scene); a Surface sized to the window is laid out each frame.

Done when: a project under Tests/Manual/Ui shows nested views with radii, borders and clipping, its --screenshot matches what is expected, and doctests cover draw order and clipping rects. Commit: [MAJOR] Add the UI renderer

Notes: the draw list (Ui/DrawList) is built on the CPU and tested headless; Rendering/UiRenderer turns it into one bgfx view (3) of signed-distance rounded rects batched by clip rectangle. Surface.Target is None or Window; a window surface is drawn over the scene, so the plan's separate overlay target is the same thing until a program can turn the scene off. Simplified for now: Opacity is multiplied down the tree instead of fading a group, clipping is rectangular (not rounded), the border colour defaults to black instead of currentColor, a border is drawn over the background rather than blended with it, and units are window pixels. Under Xvfb with Mesa the whole frame, scene included, comes out sRGB-encoded (brighter than the colours given); that is the headless driver, not the UI renderer.

[x] Step 24: Text ​

  • The Text node. Text with stb_truetype: font loading from files, a glyph atlas, measurement that Yoga uses for Text nodes, wrapping, TextAlign, LineHeight, TextOverflow = Ellipsis, Color, FontSize, FontFamily with fallback, and a bundled default font.
  • Inherited text properties (Color, FontFamily, FontSize, FontWeight, LineHeight, TextAlign) flow from ancestors.

Done when: doctests cover measurement and wrapping, the manual project shows wrapped and aligned text, and specs cover inheritance. Commit: [MAJOR] Add UI text

Notes: the default font is Noto Sans, regular and bold, under the SIL Open Font License (Assets/Fonts/OFL.txt), compiled into the engine by cmake/EmbedFile.cmake. Static faces, because stb_truetype cannot set a variable font's axes. WhiteSpace (Normal, NoWrap) was added, since an ellipsis needs a line that does not wrap. The inherited properties read "inherit" until set. Simplified: advances and kerning only (no shaping, ligatures, bidi or spans), fallback is per character in the family list, weights pick the nearest face with no synthesis, a text node's children are not laid out, and glyphs are rasterized per size into one 2048 by 2048 atlas that starts again empty when full.

[x] Step 25: Gradients, shadows, images and transforms ​

  • Linear, radial and conic gradients and layered backgrounds; BoxShadow; Image with ObjectFit and nine-slice; 2D Transform and TransformOrigin (drawing and hit testing).

Commit: [MINOR] Add gradients, shadows, images and transforms

Notes: done in several commits, one per feature. Left for later: inset shadows, repeating gradients, colour hints and several background layers. A shadow is a rounded box whose edge the UI shader blurs across the nearest edge, so it is drawn under a translucent box too. Gradients are sampled into rows of a 256 by 256 texture each frame.

Phase 8: UI input, styling and reactivity ​

[x] Step 26: UI events and focus ​

  • Pointer, wheel, keyboard and focus events with capture and bubble phases, StopPropagation and PreventDefault, pointer capture, hover and active state, PointerEvents, TabIndex and keyboard navigation, and Ui.Shortcut. Input a UI handles is not passed on to the program's own input handlers.

Commit: [MAJOR] Add UI events and focus

Notes: done in two commits, pointer events then Shortcut, which is an instance with Keys and Activated (Ui.Shortcut({ Keys = "Ctrl+S", Activated = save })) rather than a function. Left for later: the capture phase, double clicks, context menus, drag and drop, and gamepad focus.

[x] Step 27: Replace the old GUI ​

  • Remove ScreenGui, Frame, TextLabel, TextButton, ImageLabel, ImageButton, UIPadding, UIListLayout, StarterGui, PlayerGui, UDim/UDim2, Rendering/GuiOverlay, ImGuiRenderer, the ImGui shaders and the imgui dependency. Port Examples/OrbRush and the manual GUI tests to the new UI.

Commit: [MAJOR] Replace the Roblox-style GUI with the new UI

Done early, at the user's request, as part of phase 9: [MAJOR] Remove the Roblox-style GUI, UDim and Dear ImGui. Nothing needed porting, as Examples/OrbRush already drew its HUD with parts, and Tests/Manual/Gui was removed rather than ported, since Tests/Manual/Ui covers the new UI.

[x] Step 28: Style sheets ​

  • Ui.StyleSheet from Luau tables and .gss files: selectors (type, class, id, descendant, child, siblings, the state and structural pseudo-classes in ui.md, attributes), specificity, inheritance, Inherit/Initial/Unset, var() custom properties and media queries. Only nodes affected by a change are restyled. .gss files reload when they change.

Commit: [MAJOR] Add UI style sheets

Notes: a StyleSheet instance holds its rules as text in Source, which places save; Ui.StyleSheet writes a Luau table as that text, sorting its selectors, since a table has no order. A property set on a node directly, by a script, a place or a tween, wins over every sheet for good, and the node keeps its own value to restore and to save. :disabled, :checked and :selected read boolean attributes, :focus-visible is :focus, and variables come from -- declarations and -- attributes. Styles apply at the start of a surface's layout, and a change to anything a selector reads restyles the whole surface rather than only the nodes it affects. .gss files do not reload when they change yet, except through --watch.

[x] Step 29: Reactive state and animation ​

  • Ui.State, Ui.Computed, binding states to properties, styles and children, Ui.ForEach with keys, Transition and @keyframes, and Ui.Animated.

Commit: [MAJOR] Add reactive UI state and animations

Done over several commits: reactive state, Transition, tweens of UI strings, @keyframes with Animation, and style sheets that follow states.

[x] Step 30: Text input and the widget library ​

  • TextInput (selection, clipboard, undo, IME), ScrollView, and the Luau widget library (button, checkbox, radio, switch, slider, select, tabs, menu, tooltip, dialog, virtualised list, number input, colour picker, table, tree), each with specs.

Commit: [MAJOR] Add TextInput, ScrollView and the widget library (several commits, one per widget group)

Phase 9: Clean break from the Roblox API ​

One commit per system. Each updates the specs, the definitions, Examples/ and DOCS/. Done on 4 Dec 2026 at the user's request, ahead of steps 25, 26 and 28 to 30, on the clean-break branch; docs.md lists what went. Scripts now run anywhere in the game, and the legacy wait, spawn, delay, tick, elapsedTime, _G and shared globals went too.

  • Remove Players, Player, characters, LocalScript, RunContext and the server/client split; a program has one kind of script.
  • Remove BrickColor, the game/workspace globals and Roblox-only RunService answers (IsStudio, IsEdit, IsServer, IsClient, IsRunMode).
  • Rename services and datatypes whose Roblox names no longer fit (decide the names first; see "Open questions").
  • Remove Tests/Packages (vendored Roblox packages) and their specs.
  • Replace project folders named after Roblox services with a layout for programs (main.luau and modules), and update projects.md.

Work outside the plan ​

Built after step 14 at the user's request. The details and the choices made are in "Open questions" below; this is the index. Later steps must account for these, especially step 17 (what to save) and step 19 (what to stop when a game closes).

  • Instance: FindFirstChildWhichIsA, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, IsAncestorOf, WaitForChild, attributes, tags, Clone and Archivable.
  • Scripts: Script.Enabled (a script owns the threads and connections it creates), Script.RunContext, modules that yield while loading, _G and shared, and enum names or numbers wherever an enum is expected.
  • Value objects: BoolValue, IntValue, NumberValue, StringValue, ObjectValue (held weakly), Vector3Value, CFrameValue, Color3Value.
  • BindableEvent and BindableFunction, with tables passed as copies (Variant gained Dictionary).
  • Services: Debris, HttpService (JSONEncode, JSONDecode, GenerateGUID; no network), TweenService with Tween and TweenInfo, CollectionService, ServerStorage, and RunService's IsServer, IsClient, IsStudio, IsRunning, IsEdit and IsRunMode (these first answered as a running server everywhere; step 19 changed them, see its entry under "Open questions").
  • Datatypes: Random (PCG32, so a seed gives the same sequence every run but not Roblox's numbers), NumberRange, Ray, Rect, Region3, NumberSequence, ColorSequence, DateTime and BrickColor.
  • Examples/: example projects run with Gamma play, starting with OrbRush, a small arena game that uses most of the engine. Its notes are in Examples/README.md.
  • Profiler: Core/Profiler times nested zones and per-frame counters on the main thread. Gamma play --profile <File> writes a report and --vsync off stops waiting for the display; the editor has a Profiler panel; scripts use debug.profilebegin and debug.profileend. Definitions now declare engine additions to Luau's own libraries as typeof(lib) & { ... }.
  • Renderer for large scenes: parts are drawn instanced, from growable GPU buffers, so there is no limit on visible parts. Rendering/PartRegistry keeps a flat copy of each BasePart's bounds and draw data, updated through BasePart's observer when a part changes, and the GPU keeps a copy of that between frames. Parts that change move to a dynamic region at the end of the copy, and back once they stop, so each frame uploads one range of the moving parts and a few scattered slots instead of every part. Opaque parts are drawn straight from the GPU's copy without CPU culling; only the partly transparent ones go through Rendering/SceneBatch, which culls and sorts them across Core/ThreadPool. bgfx renders on its own thread, except on macOS. Tests/Manual/Stress and Tests/Manual/RenderEdgeCases exercise it.
  • Workspace:Raycast(origin, direction, params) against parts, with no physics engine: a Ball part is a sphere as wide as its smallest side and every other part its box (a Cylinder too, for now). A ray that starts inside a part does not hit it. RaycastParams.new() returns a plain table of FilterDescendantsInstances, FilterType (Enum.RaycastFilterType), IgnoreWater, RespectCanCollide and CollisionGroup, and the result is a table of Instance, Position, Normal and Distance, so typeof gives table for both. Jolt (Later) should replace the search.
  • game:BindToClose and ScriptEngine::Close, which Gamma run calls once nothing is left to run, stepping for up to 30 seconds while the callbacks yield. Gamma play calls it too when its window closes; the editor's play copy does not yet.
  • Game UI instances, before the UI renderer: GuiBase2d (AbsolutePosition and AbsoluteSize, worked out on each read from Size, Position and AnchorPoint up to the ScreenGui, which covers Workspace.CurrentCamera.ViewportSize; they fire no change notifications), ScreenGui, GuiObject, Frame, TextLabel, ImageLabel, GuiButton (Activated and MouseButton1Click, fired by UserInputService when a left click begins and ends on the topmost visible button in the local player's PlayerGui; that click's InputBegan and InputEnded pass gameProcessedEvent as true, and other elements do not block clicks yet), TextButton, ImageButton, the StarterGui service and PlayerGui. Camera.ViewportSize is 1280 by 720 until a window sets it. The local player has a PlayerGui from the start and gets a copy of each StarterGui child as it joins. Default sizes (100 by 100, or 200 by 50 for text and text buttons) and texts (Label, Button) are Gamma's own. UIPadding insets its parent's content, and UIListLayout places its parent's visible GuiObjects one after another (FillDirection, SortOrder, Padding; no alignment yet). No other layouts, fonts, TextBounds or rich text yet.
  • Single player: LocalScripts and the Client run context run, and RunService:IsClient() is true (the step 15 answer). DataStoreService saves data locally, documented in datastores.md; Gamma play gives it a per-user save directory. Players has one LocalPlayer (Player, named Player, UserId 0) that exists from the start and joins, firing PlayerAdded, on the first step after Players is in a game. Player.Character is a weak reference that fires CharacterAdded and CharacterRemoving when set; nothing makes characters until there are parts and physics.
  • From the instance-system branch (see the 15 Nov merge note): Model with pivots, Players with a LocalPlayer, UserInputService:GetKeysPressed and IsMouseButtonPressed, Workspace:GetPartBoundsInBox, GetPartBoundsInRadius and GetPartsInPart, Model:GetBoundingBox, TweenService:SmoothDamp, HttpService:UrlEncode, Instance:IsPropertyModified, the tick, time, elapsedTime and delay globals, and RunService's PreAnimation, PreSimulation and PostSimulation.
  • MeshPart with MeshId, TextureId and the read-only MeshSize, documented in projects.md. Core/Mesh reads models with assimp (in place of fastgltf, which reads only glTF) into one rigid shape fitted to a unit box, and loads them in the background like Ui/Image. Rendering/MeshRenderer draws them instanced per model and texture, with mipmapped textures, cut-out alpha in the opaque pass and partly transparent meshes sorted after the transparent parts. PartRegistry leaves MeshParts out. cmake/FixedPorts overlays vcpkg's kubazip port, an assimp dependency whose release archive changed hash after the baseline.
  • Ray tracing: Core/Bvh builds bounding volume hierarchies, and every loaded model keeps one over its triangles. Workspace:Raycast uses it to hit a MeshPart's triangles rather than its box. "Shadows": "RayTraced" in Gamma.json turns on per-pixel sun shadows, documented in projects.md. Rendering/ShadowScene packs a top-level hierarchy over the opaque parts and every model's triangles into float textures, and Shaders/Shadows.sh walks them in the part and mesh pixel shaders. bgfx has no hardware ray tracing, so this uses only texture reads, which every backend has (the web build is untried). The walk keeps no stack, following miss links laid out depth first, because a stack in a local array lost its writes on every backend tried (Direct3D 11 and 12, Vulkan and OpenGL). TraceShadowRay walks the same texels on the CPU, for tests.
  • Lighting, documented in lighting.md: the Lighting service (sun from ClockTime and GeographicLatitude, ambient, environment scales, exposure, fog, GlobalShadows, ShadowSoftness), PointLight, SpotLight and SurfaceLight, the BloomEffect, SunRaysEffect and ColorCorrectionEffect post effects, Atmosphere, and BasePart.Material and Reflectance. Names, defaults and enum values follow Roblox, like the rest of the current API, so the "Clean break" phase renames them with everything else. Their settings live in one plain struct per class (SettingsInstance in Instances/Lighting.h), which the renderer reads each frame.
  • Post-processing: Rendering/PostProcess draws the scene into an RGBA16F frame buffer (BGRA8 where the GPU cannot draw into floats), multisampled 4x where the GPU allows, in place of the multisampled window. It then blooms (Call of Duty: Advanced Warfare's 13 tap downsample with a Karis average on the first level, and tent filter upsampling, one level per halving of BloomEffect.Size), tone maps with Stephen Hill's ACES fit, applies ColorCorrectionEffects and dithers onto the window or DrawSceneToTexture's texture. Part colours and textures are decoded from sRGB in the shaders. The scene owns views 0 to SceneViewCount - 1 (32), and the overlays draw after them.
  • Physically based lighting: Rendering/SceneLighting works out the sun, moon and sky colours from Lighting (GetSkyLight), gathers the 32 lights whose reach comes nearest the camera (GatherLights), holds the material table and draws the sky. Shaders/Shading.sh shades with Lambert and GGX, analytic sky lighting and reflections (Karis's environment fit), the lights, emission, the Atmosphere's haze and fog. A part's material and reflectance are packed into its colour's alpha beside its opacity (see PartInstance), which keeps instances at 64 bytes and leaves PartBatch boxes as plain Plastic. Shaders/PartFragment.sc draws procedural surface patterns per material in part space. There are no textures for materials and no image based lighting from the scene itself.
  • Cascaded shadow maps, the default Shadows mode (ShadowMap): Rendering/ShadowMaps fits 4 cascades around slices of the view out to 500 studs (FitCascades, bounding spheres snapped to whole texels so edges do not shimmer) in one 4 by 1 depth texture, laid out side by side because how a view rectangle lands vertically in a frame buffer differs between backends. Opaque parts, PartBatch boxes and meshes (with cut-out pixels discarded) are drawn into each cascade. Shaders/Shadows.sh filters 16 samples on a Vogel spiral, turned per pixel, with normal offset and depth bias, and fades out at the last cascade. Renderer::SetShadows takes a ShadowMode, and Lighting.GlobalShadows turns either mode off. MeshRenderer now gathers in Prepare and draws in SubmitShadowCasters and Submit. Only the sun or moon casts shadows; local lights do not.
  • Ambient occlusion: Rendering/AmbientOcclusion draws the opaque scene's view space normals and depth into an RGBA16F target (with the scene's own vertex shaders, so the normal fragment shaders take every one of their varyings, as bgfx makes a program only when they match exactly), then works out occlusion at half resolution from 12 samples in the normal's hemisphere, turned per pixel, and blurs it in two depth-aware passes. Shading.sh multiplies only the ambient and sky reflection terms by it, in the opaque pass. MeshRenderer::SubmitShadowCasters became SubmitOpaque, shared by the cascades and this pass.
  • Part shapes: PartRegistry marks the slots of Parts whose Shape is not Block (GetShaped) and leaves them undrawn, and MeshRenderer draws them instanced with generated meshes for the ball, cylinder, wedge and corner wedge, so they share its sorting, shadow casting and ambient occlusion. Part:SetShape now tells the part's observer. They have no surface pattern and no ray-traced shadow.

Open questions ​

Add an entry here when a step raises a decision. Give the step number, the question and, once answered, the answer. Entries marked "Ask the user" are not answered yet.

  • Phase 9: is Instance renamed (for example to Object or Node), and are CFrame, Enum and the service names kept? Answer (user): Instance and Enum stay; services become globals with new names (Scene, Run, Input and the rest), CFrame becomes Transform and Color3 becomes Color, in the Luau API. The C++ types keep their names.

  • Phase 9: should script files keep the .server.luau/.client.luau suffixes during the transition, or is the program layout changed in one step? Answer (user): in one step, to a main.luau and an assets folder; relative asset paths resolve against the project folder (Core/Assets).

  • Step 21: does a UI tree live in the same object tree as everything else (under the DataModel), or in a separate tree per surface? Answer for now: the same tree, so registry, saving and bindings are reused; a Surface can sit anywhere.

  • Step 24: which font is bundled as the default? It must have a licence that allows shipping it inside programs (for example Inter or Noto Sans under the OFL). Answer: Noto Sans regular and bold, under the OFL; see step 24.

  • Step 2: which selene standard library to use? Answer: the built-in luau std. The roblox std would accept Roblox-only globals that Gamma does not have. Gamma globals now live in the custom std gamma.yml; step 14b generates it.

  • Step 6: how does a method return a table or a signal? Answered in step 10 below.

  • Step 6: member lookup walks the superclass chain on every access. gargantuan flattens each class's inherited members into one table once. Worth doing if lookup shows up in profiles.

  • From gargantuan, for later steps: property descriptors there carry a serialisable flag and a default value (useful for step 17's "not serialised" marker and for writing only changed properties), and read/write permission levels (useful for sandboxing). Class definitions there are generated from Luau data files, which could also feed step 14b.

  • Step 7: gargantuan's RunService uses Roblox's newer PreSimulation, PostSimulation and PreRender events. The plan keeps Heartbeat and Stepped; the newer names can be added beside them later.

  • Step 7: DataModel derives from ServiceProvider, as in Roblox (idea taken from gargantuan), so game:IsA("ServiceProvider") holds. Destroying a DataModel is not handled: ClearAllChildren on it throws at the first service. Step 19 defines closing a place.

  • Step 8: vcpkg port or FetchContent for Luau? Answer: the vcpkg port (luau 0.746 at the current baseline). It builds static libraries and exports unofficial::luau::Luau.VM, Luau.Compiler, Luau.Analysis, Luau.Require, Luau.CodeGen and the rest through find_package(unofficial-luau CONFIG). Engine headers are under include/luau, including the VM's internal headers.

  • Step 8: print and warn join their arguments with a space, as Roblox does, not with Luau's tab. Each ScriptEngine::Run uses a new sandboxed thread, so a script's globals do not leak into the next one. _G and shared are not built; decide how scripts share them when a package needs it.

  • After step 8 (asked for by the user): LogService replaces step 8's output callback. ScriptEngine takes a DataModel and writes print, warn and script errors to its LogService, which fires MessageOut(Message, MessageType). Step 18's Output panel listens to MessageOut. MessageOut and Enum.MessageType were registered in step 12. GetLogHistory is not built.

  • Step 9: specs need a shared helper before step 13's require. Answer (user): bring Luau's require library forward for files. ScriptEngine::RunFile loads a file with an @path chunk name and require("./Path") resolves x.luau, x.lua and x/init.luau relative to the requiring file, with .luaurc lookup for aliases. Module chunk names are relative to the working directory, which assumes it does not change while scripts run.

  • Step 9: the helper (Tests/Luau/Test.luau) fails fast: the first failed expect stops the spec. Each spec runs from the source root so error paths stay short.

  • Step 10: how do methods return a table or a signal (the step 6 question)? Answer (user): extend Variant with std::shared_ptr<const Array> and std::shared_ptr<const EventReference>. Both sit behind a pointer because they contain Variants, and compare by identity. GetChildren, GetDescendants and GetPropertyChangedSignal are method descriptors, and event access by name builds the same EventReference through MakeEventReference. EventDescriptor gained Once. Dictionary was added the same way later, for attributes.

  • Step 10: a Luau handler runs synchronously inside Fire, in a new thread, so it can yield and its error is logged without stopping the code that fired it. Signal:Wait resumes the waiting thread directly from Fire. Both are still immediate after step 11. Roblox now defaults to deferred signal behaviour, so revisit this if a package depends on handlers running later.

  • Step 10: a Luau handler connected to an instance's signal holds a registry reference to its function, so a closure that captures that instance keeps it alive until the connection is disconnected or the instance is destroyed, as in Roblox.

  • Step 10: luau-lsp has no definitions for Gamma globals yet, so specs show type errors in the editor. Step 14b generates them.

  • Step 11: what counts as "connections that could wake a thread" for Gamma run? Answer: only connections to RunService.Stepped and Heartbeat, because those fire on every step with no script running. Any other signal can only fire from a running thread, so when nothing is scheduled it can never fire. A thread waiting on such a signal does not keep Gamma run alive, and a Heartbeat connection that is never disconnected keeps it running forever. Playing tweens step on Heartbeat, so they keep it running until they finish. If the file's main chunk is left waiting when nothing can resume it, Gamma run exits 1.

  • Step 11: the scheduler steps from a C++-only RunService.EngineStepped signal (first named ResumeWaitingThreads), fired between Stepped and Heartbeat, so its own connection does not count as pending work. Debris uses it too. Deferred threads run when the outermost ScriptContext::Resume returns, which is after the thread that deferred them yields or finishes. There is no limit on re-deferring (Roblox stops at 80), so a thread that re-defers itself forever hangs the engine.

  • Step 11: the legacy wait behaves as task.wait (no 1/30 s minimum, one return value) and the legacy spawn(f) as task.delay(0, f). Gamma run steps with a fixed 1/60 s delta and exits non-zero if any error was logged, including errors in threads resumed after the file returned.

  • Step 12: does Vector3 use Luau's native vector? Answer: no. Datatypes are tagged userdata, because typeof on a native vector cannot return "Vector3". The shared userdata helpers are in Scripting/Userdata.h. Revisit only if vector math shows up in profiles.

  • Step 12: CFrame and the other datatypes are plain C++ types in DataTypes/, independent of Luau, so the renderer and place files can use them. Vector negation keeps negative zero, as Roblox prints it. Enums are registered in the class registry.

  • Step 13: Name.server.luau gives a Script with the Legacy run context, as Rojo does. A Script starts at the next point where the engine gets control back from Luau, not in the middle of the change that put it there. game, workspace and script are compiled as mutable globals, because Luau otherwise resolves paths such as script.Parent.Name once at load. The rules are in projects.md.

  • Step 14: both packages (sleitnick/signal 2.0.3 and evaera/promise 4.0.0) passed without changes to Gamma beyond a selene exclusion for the vendored files. Nothing is left to fix.

  • Step 14a: the asan preset is Linux only. MSVC has AddressSanitizer but no leak detection, which is what this job is for. Luau and the other vcpkg ports are built without sanitizers; only Gamma's own code is instrumented.

  • Step 14a: the lint job had been failing before any of its Luau checks ran, because two lines in ClassRegistry were not clang-formatted, so the hand-written gamma.yml had 20 selene errors nobody saw. Step 14b formatted those lines and replaced the file.

  • Step 14b: how precisely are members typed? Answer (user): names now, types later. Every member is any, and methods take and return ...any. Typing them needs a Luau type on each property, method and event descriptor and each datatype member; add that when the editor or a package needs it.

  • Step 14b: the definitions use luau-lsp's declare extern type syntax (declare class no longer parses). The registry has no member types, so the datatype bindings each list the members their __index resolves (GetDataTypeMembers), and a doctest indexes every listed member. A member added to a binding but not to its list shows up as an unknown member in the editor. Operators come from each userdata type's metatable. Every class has a [string]: Instance indexer, since the engine looks up children by name and indexers are not inherited. script is added by hand, because it exists only on each script's own thread.

  • Step 14b: luau-lsp analyze still reports errors in Tests/Luau that are not about unknown globals or members: require of an instance (it needs a Rojo-style sourcemap) and mixed-type tables that strict mode rejects. CI does not run analyze; add it once those are fixed.

  • Step 15: should Gamma play run LocalScripts and answer as a client? Answer (user): yes, as Play Solo does: Gamma play runs Scripts and LocalScripts in one process, and IsClient() and IsServer() are both true there; Gamma run stays server only. The user added that Gamma is mainly for single player games, so there should not really be a separate server; a multiplayer service can come later if it is needed. RunService.RunsClient (C++ only) holds the answer and must be set before the ScriptEngine is made.

  • Step 15: where does a LocalScript run without Players? Answer: where a RunContext.Client script runs, under Workspace or ReplicatedStorage, since there is no PlayerGui, Backpack or PlayerScripts. Revisit when a player exists. A LocalScript ignores its RunContext.

  • Step 15: Luau specs feed input through VirtualInputManager (SendKeyEvent, SendMouseButtonEvent, SendMouseMoveEvent, SendMouseWheelEvent, with Roblox's signatures), which calls the same UserInputService::ProcessInput entry point as the window. KeyCode item 0 is None, as in Roblox's current API (its legacy name Unknown is not registered), and the deprecated World0 to World95 keys are left out. Only keyboard and mouse input exist; touch, gamepads, text input and Focus events are not sent.

  • Step 16: the bgfx port at the baseline (1.129.8940-496) builds shaderc with its tools feature and exports bgfx_compile_shaders, which compiles the shaders in Source/Rendering/Shaders into headers for every backend at build time. bgfx renders on the main thread (renderFrame before init) with vsync, so Gamma play steps once per displayed frame instead of at a fixed 60 Hz. Each frame fires RenderStepped, draws and then steps RunService, in Roblox's order.

  • Step 16: BasePart and Camera derive from Instance, not from Roblox's PVInstance, so IsA("PVInstance") is false. Size is not clamped to Roblox's 0.001 to 2048 range, and Part.Shape does not exist: every part is drawn as a box. Transparent parts are drawn after opaque ones, back to front, without writing depth. Workspace.CurrentCamera is held weakly. Roblox makes a new camera when the current one is destroyed or set to nil; Gamma does not, and the renderer then draws from an identity CFrame with a 70 degree field of view.

  • Step 16: Workspace now always has a Camera child, which step 17 must handle when it loads a saved Workspace into a game that already made one.

  • Step 17: the format is in places.md. Source/Instances/Json builds and parses each value, and the place writer lays out the instance tree itself, one property per line, so diffs stay small; it stays in Instances/, since it works on Variant. simdjson was not added: no place is large enough yet to measure. PropertyDescriptor.Serialized marks a property that place files leave out (Archivable, BasePart.Position). Float components are written in their shortest float form and read back through a double; a test checks 100,000 random floats come back bit for bit.

  • Step 17: loading is strict: an unknown class or property, or a value of the wrong shape, stops the load rather than being skipped, and a reference saved as null leaves the property at its default. Services are saved only when they hold something, and in class name order. Loading a Workspace that sets CurrentCamera destroys the camera the new Workspace was made with. LoadPlace adds to the game it is given; step 19 loads into a new DataModel, which is the case it is built for.

  • Step 17: the ctest entry for a place is a place file in Tests/Places, run by Gamma run, whose Script checks what was loaded. A Luau spec cannot do it, because a place's scripts have no file to require the spec helper by path.

  • Step 18: the vcpkg imgui port (1.93.0) has the docking branch and the SDL3 backend, but no bgfx backend, since upstream ImGui has none. Answer (user): write a small one. Editor/ImGuiRenderer draws ImGui in bgfx view 2, after the scene's views 0 and 1, with shaders compiled by shaderc like the part shaders, and supports ImGui's texture requests (ImGuiBackendFlags_RendererHasTextures). ImGui adds glyphs to its font texture after creating it, and bgfx makes a texture created with its pixels immutable, so textures are created empty and filled with updateTexture2D.

  • Step 18: the viewport has its own fly camera rather than moving Workspace.CurrentCamera, which Roblox Studio does, so looking around never changes the saved place. The layout is built in code every run (IniFilename is null) instead of writing an imgui.ini wherever the editor was started. Open asks for a typed path until a file dialog is added. Undo is not built; it is in "Later".

  • Step 18: MessageType::Info was added for the editor's own messages, such as "Saved". Editor operations live in Editor/EditorOperations and throw with a message, which the panels send to the Output panel.

  • Step 19: closing a game is two steps, in this order: destroy its ScriptEngine, which closes the Luau state and with it every script, thread, delayed callback and Luau handler, then DataModel::Close, which destroys every instance under the services and disconnects RunService's step handlers, so tweens, Debris and the scheduler never step again even if something still holds the old RunService. Then the tree is freed. PlaySession does both at Stop. A test runs ten play and stop cycles of a script that leaves connections, a tween, a Debris item, delayed and looping threads and references running, and checks every instance of every copy is freed.

  • Step 19: RunService's answers now come from the game: IsClient is true in Gamma play and in the editor's play copy; IsEdit is true and IsRunning false only in the place being edited; IsStudio is true for both the edited place and its play copy; IsServer is always true and IsRunMode always false, since only Play Solo exists. Gamma run and Gamma play answer as before.

  • Step 19: while playing, the viewport shows the copy from its Workspace.CurrentCamera, the Explorer and Properties show and edit the copy (those edits are lost at Stop, as in Studio), and input reaches the copy's UserInputService only while the viewport has focus. Save during play saves the edited place, not the copy. Each frame of play fires RenderStepped, steps RunService and then draws.

  • Merge of the instance-system branch on 15 Nov (asked for by the user): that branch was built in parallel with steps 15 to 19 and had its own window, place files, parts, editor operations, Selection, UserInputService and definitions generator. Play mode's versions of those were kept, and the rest was ported onto them, one commit per feature. Decisions that changed:

    • LocalScripts and the Client run context run wherever a Script runs, in Gamma run as well as Gamma play, and RunService:IsClient() is always true (that branch's single player answer below). RunService.RunsClient is gone. A LocalScript still also runs under ReplicatedStorage, since there is no PlayerScripts.
    • Step 14b: members are typed now, with that branch's generator (the user's choice), replacing the one that typed every member as any. A definition can add to one of Luau's own libraries, which debug.profilebegin and debug.profileend use.
    • Step 16: BasePart and Camera derive from PVInstance, Size is clamped to at least 0.001, and Part.Shape exists, though the renderer draws every shape as a block. Workspace is a Model, and its camera is still saved in place files.
    • The datatypes added there (Ray, Rect, Region3, the sequences, DateTime, BrickColor) are written in play mode's place format, listed in places.md.
    • That branch's notes follow as it wrote them. Where they disagree with the notes above, the notes above and this entry win.
    • Step 2: which selene standard library to use? Answer: the built-in luau std. The roblox std would accept Roblox-only globals that Gamma does not have. Gamma globals (Vector3, task, game) will need a custom std file once Luau specs use them.
    • Step 6: GetChildren, GetDescendants and GetPropertyChangedSignal have no method descriptors yet, because Variant cannot hold an array or a signal. Step 10 needs to decide how a method returns a table or a signal to Luau (an array alternative in Variant, or a descriptor that pushes to the Luau stack directly).
    • Step 6: member lookup walks the superclass chain on every access. gargantuan flattens each class's inherited members into one table once. Worth doing if lookup shows up in profiles after step 10.
    • From gargantuan, for later steps: property descriptors there carry a serialisable flag and a default value (useful for step 17's "not serialised" marker and for writing only changed properties), and read/write permission levels (useful for sandboxing). Class definitions there are generated from Luau data files, which could also feed the luau-lsp type definitions.
    • Step 7: gargantuan's RunService uses Roblox's newer PreSimulation, PostSimulation and PreRender events. The plan keeps Heartbeat and Stepped; the newer names can be added beside them later. (PreAnimation, PreSimulation and PostSimulation were added on 14 Nov; PreRender waits for step 16.)
    • Step 7: DataModel derives from ServiceProvider, as in Roblox (idea taken from gargantuan), so game:IsA("ServiceProvider") holds. Destroying a DataModel is not handled: ClearAllChildren on it throws at the first service. Decide what closing a place does when play mode (step 19) needs it.
    • Step 8: vcpkg port or FetchContent for Luau? Answer: the vcpkg port (luau 0.746 at the current baseline). It builds static libraries and exports unofficial::luau::Luau.VM, Luau.Compiler, Luau.Analysis, Luau.Require, Luau.CodeGen and the rest through find_package(unofficial-luau CONFIG). Engine headers are under include/luau, including the VM's internal headers.
    • Step 8: print and warn join their arguments with a space, as Roblox does, not with Luau's tab. Each ScriptEngine::Run uses a new sandboxed thread, so a script's globals do not leak into the next one; step 13 may need to revisit this when scripts share state through _G or shared.
    • After step 8 (asked for by the user): LogService replaces step 8's output callback. ScriptEngine takes a DataModel and writes print, warn and script errors to its LogService, which fires MessageOut(Message, MessageType). Step 18's Output panel listens to MessageOut. MessageOut is not in the registry yet, because Variant has no Enum.MessageType; register it in step 12. GetLogHistory is not built.
    • Step 9: specs need a shared helper before step 13's require. Answer (user): bring Luau's require library forward for files. ScriptEngine::RunFile loads a file with an @path chunk name and require("./Path") resolves x.luau, x.lua and x/init.luau relative to the requiring file, with .luaurc lookup for aliases. Step 13 still adds require(ModuleScript), cyclic require errors and the project folder mapping. Module chunk names are relative to the working directory, which assumes it does not change while scripts run.
    • Step 9: the helper (Tests/Luau/Test.luau) fails fast: the first failed expect stops the spec. Each spec runs from the source root so error paths stay short.
    • Step 10: how do methods return a table or a signal (the step 6 question)? Answer (user): extend Variant with std::shared_ptr<const Array> and std::shared_ptr<const EventReference>. Both sit behind a pointer because they contain Variants, and compare by identity. GetChildren, GetDescendants and GetPropertyChangedSignal are now method descriptors, and event access by name builds the same EventReference through MakeEventReference. EventDescriptor gained Once.
    • Step 10: a Luau handler runs synchronously inside Fire, in a new thread, so it can yield and its error is logged without stopping the code that fired it. Signal:Wait resumes the waiting thread directly from Fire. Step 11 decides whether either should be deferred to the scheduler. A script that yields at the top level now counts as success; nothing resumes it except a signal it waits on.
    • Step 10: a Luau handler connected to an instance's signal holds a registry reference to its function, so a closure that captures that instance keeps it alive until the connection is disconnected or the instance is destroyed, as in Roblox.
    • Step 10: selene uses a custom std (gamma.yml, based on luau) declaring game, workspace and Instance.new. Instances are any there. luau-lsp has no definitions for Gamma globals yet, so specs using them show type errors in the editor; a definitions file could be generated from the registry.
    • Step 11: what counts as "connections that could wake a thread" for Gamma run? Answer: only connections to RunService.Stepped and Heartbeat, because those fire on every step with no script running. Any other signal can only fire from a running thread, so when nothing is scheduled it can never fire. A thread waiting on such a signal does not keep Gamma run alive, and a Heartbeat connection that is never disconnected keeps it running forever.
    • Step 11: the scheduler steps from a C++-only RunService.ResumeWaitingThreads signal, fired between Stepped and Heartbeat, so its own connection does not count as pending work. Deferred threads run when the outermost ScriptContext::Resume returns, which is after the thread that deferred them yields or finishes. There is no limit on re-deferring (Roblox stops at 80), so a thread that re-defers itself forever hangs the engine.
    • Step 11: the legacy wait behaves as task.wait (no 1/30 s minimum, one return value) and the legacy spawn(f) as task.delay(0, f). Gamma run steps with a fixed 1/60 s delta and exits non-zero if any error was logged, including errors in threads resumed after the file returned.
    • Step 12: should Vector3 use Luau's native vector type? Answer: no, it is a tagged userdata like the other datatypes. typeof on a native vector always returns "vector" (luaT_objtypenamestr reads __type only from userdata metatables), and packages check typeof(x) == "Vector3"; changing that means patching the VM. The cost: a Vector3 is a heap allocation, and two equal vectors are different table keys, which differs from Roblox. Components are single precision, as in Roblox. Revisit if vector maths shows up in profiles.
    • Step 12: the build container for this run had no vcpkg (its bootstrap was blocked), so Luau 0.746 (with the vcpkg port's patch), doctest 2.5.3 and GLM 1.0.3 were built from source at the vcpkg baseline's versions into a local prefix. StyLua and Selene were not available, and the local clang-format is 18 rather than CI's 23.1.5, so CI's lint job is the first real check of those commits.
    • Step 12: Roblox's docs fix some details the specs check: Color3:ToHSV gives hue 1, not 0, for pure red; Color3:ToHex is lowercase; white:Lerp(black, 0.85) prints 0.15, so Lerp runs in double precision before rounding to float; negating keeps -0 (CFrame.new().LookVector prints -0, -0, -1). Unknowable from the docs and chosen here: UDim offsets truncate toward zero; CFrame:ToAxisAngle of the identity gives the X axis; CFrame:FuzzyEq compares each rotation matrix element, not an angle; CFrame.lookAt falls back to the X axis as up when looking along up. Color3:GetLuminance was added because the docs list it.
    • Step 12: enums live in the class registry (ClassRegistry::AddEnum). The owner of an enum registers it (LogService adds MessageType); the datatype enums (Axis, NormalId, RotationOrder) are registered in ClassRegistry.cpp. A C++ enum converts to an EnumItem through an EnumTraits<T> specialisation naming its registered enum, mapped by value, so the C++ values must match Roblox's (MessageType is now Output = 0, Warning = 2, Error = 3). Enum, each Enum.X and each EnumItem is one cached userdata, so they work as table keys. LogService.MessageOut is now registered. Not built: Roblox's coercion of strings and numbers to enum properties, which step 15/16 may need once instances have enum properties.
    • Step 13 (approved by the user): how should require("./Path") resolve for instance scripts? Answer for now: by file. A script loaded from a project keeps its file in LuaSourceContainer::SourcePath (C++ only, not reflected) and uses it as its chunk name, so path and .luaurc alias requires go through the existing file navigator. When that navigator loads a file that a ModuleScript in the game came from, it requires the ModuleScript instead, so both kinds of require share one cached result. A script with no file (made at runtime) is named by its full name (=ServerScriptService.Main), as in Roblox, and can only require instances. The alternative is a second navigator that walks the instance tree, as Roblox's own require-by-string does; it would let runtime scripts require by path, but .luaurc aliases have no place in the instance tree. Switch if packages need it.
    • Step 13: a Script runs when it is under Workspace or ServerScriptService (exact class Script), once per instance, deferred to the next resumption point; TaskScheduler::Step now starts by resuming deferred threads so scripts added from C++ start on the next step. LocalScript derives from Script, as in current Roblox, and never runs: there is no client yet (step 15 may want Gamma play to run them). Not built: RunContext. (Enabled and stopping a script's threads were added later, outside the plan; see the entry below.)
    • Step 13: module errors use Roblox's wording (Requested module was required recursively, Module code did not return exactly one value, Requested module experienced an error while loading, with the module's own error appended), and require of a non-module is Attempted to call require with invalid argument(s).. A failed module is not cached, so requiring it again retries. A module may not yield (Roblox allows it); file modules already had this limit.
    • Step 13: the project layout (documented in DOCS/projects.md) maps top-level folders to services by name, so a project needs no project file. Only init.luau makes a folder a module; init.server.luau and init.client.luau are not supported.
    • Step 14: vendored sleitnick/signal 2.0.3 and evaera/promise 4.0.0 (sources and commits in Tests/Packages/README.md), excluded from StyLua (.styluaignore) and Selene (exclude in selene.toml). Both passed unmodified with no change to Gamma. Not fixed yet: Promise measures Promise.delay with os.clock, which is wall time, while the scheduler counts fixed 1/60 s steps from the start of each frame, so a delay started mid-frame can report up to about a frame less than asked. The spec allows a frame of difference. Driving the scheduler clock from real frame time in Gamma play (step 15) would remove most of it, at the cost of the deterministic timing the Task specs rely on, so keep the fixed step for Gamma run.
    • Step 15 (blocked, needs the user): the vcpkg baseline pins SDL 3.4.20. Building it from source here (release-3.4.20, X11 only, static) was refused by the session's auto-mode permission check, and so was the vcpkg bootstrap earlier, so SDL3 cannot be built or tested in this container. Xvfb is installed, so the window and input code could be exercised headlessly once SDL builds. Planned choices, pending: sdl3 in vcpkg.json with default-features: false and the x11 and wayland features on Linux (dropping ibus, which pulls in dbus), plus an apt step in the Linux CI job for the X11 and Wayland headers. To unblock: allow building SDL from source (or the vcpkg bootstrap) in this environment, or run Step 15 locally.
    • Outside the plan, while Step 15 was blocked (the user said to continue): three scripting commits.
      • [FIX] Read script and game members at run time: in a sandboxed environment luau_load resolves global paths such as script.Parent.Name once, at load time, so scripts read stale values. Every chunk is now compiled through CompileSource (Source/Scripting/Compile.cpp) with game, workspace and script as mutable globals.
      • [FIX] Make task.wait in a newly started script wait a step: TaskScheduler::Step resumed deferred threads before choosing the due timed threads, so a Script started by a step that called task.wait() resumed again in the same step. Due threads are now chosen first.
      • [MINOR] Add Script.Enabled and stop scripts when disabled or destroyed: each run of a Script owns the threads it creates (Luau thread data, inherited through the userthread callback, task and event handlers) and the connections it makes. Disabling or destroying the script disconnects them and drops its scheduled threads; re-enabling runs it again from the start. Moving a running script out of its container does not stop it, as in Roblox. Limits: the thread that stops its own script keeps running until it yields, and threads a ModuleScript starts while loading belong to no script. Documented in DOCS/projects.md.
    • Found while checking the above under AddressSanitizer, not fixed (unrelated to the change): the C++ test Reparenting fires events in order (Tests/Instance.cpp) leaks, because its handlers capture the instances whose signals hold them. Every other test is clean under ASan and UBSan.
    • More Instance API, outside the plan (Step 15 still blocked). Behaviour follows the Instance page in Roblox's creator-docs; error wording the docs do not give is Gamma's own.
      • [MINOR] Add ancestor and WhichIsA lookups to Instance: FindFirstChildWhichIsA (with recursive), FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, IsAncestorOf.
      • [MINOR] Add Instance:WaitForChild: yields until a child with the name is added; with a time out it resumes with nil; without one it warns Infinite yield possible on '<FullName>:WaitForChild("<Name>")' after 5 seconds. It is bound in InstanceBindings.cpp rather than the registry, because registry methods cannot yield. TaskScheduler::DelayCallback was added for the time out and the warning. Not handled: a child renamed to the name after it was added does not end the wait.
      • [MINOR] Add instance attributes: SetAttribute, GetAttribute, GetAttributes, GetAttributeChangedSignal, AttributeChanged. Names: 1 to 100 of letters, digits, _ . - /, not starting with RBX. Values: boolean, number, string, Vector3, Vector2, Color3, UDim, UDim2, CFrame, EnumItem. Setting the same value again fires nothing. Variant gained a Dictionary type for GetAttributes.
      • [MINOR] Add Instance:Clone and Archivable: copies writable registry properties (all but Parent), attributes and archivable descendants. Not copied: LuaSourceContainer::SourcePath (C++ only), so a cloned file-backed script can no longer require by relative path. Instance references inside the cloned tree are not remapped yet; no property holds one besides Parent.
    • The user approved every decision recorded above, including the Step 13 require-by-file choice.
    • Run at 07:21 Oslo, 13 Nov (SDL build still refused, so scripting work continued):
      • [MINOR] Add value objects: BoolValue, IntValue, NumberValue, StringValue, ObjectValue, Vector3Value, CFrameValue, Color3Value under ValueBase, all one C++ class (Source/Instances/Values.cpp) told apart by class name. Changed (and the deprecated changed) passes the new value, as Roblox documents; GetPropertyChangedSignal("Value") still works. Chosen where the docs say nothing: IntValue drops a fraction toward zero, like UDim.Offset; a type error reads Unable to assign property Value. <type> expected, got <type>. StringValue rejects more than 200,000 characters with String too long, as documented.
      • [FIX] Point cloned references at the copied instances: Clone rewrites an instance-valued property that points inside the cloned tree (such as ObjectValue.Value) to the copy, as the ObjectValue docs describe.
      • [FIX] Hold ObjectValue references weakly: an ObjectValue pointing at its own ancestor made a reference cycle that AddressSanitizer reported as a leak. It now holds its instance weakly, so an instance kept alive only by an ObjectValue is freed and the value reads as nil. This differs from Roblox, where the reference keeps the instance alive; change it back if that matters more than the cycle. (The clone-references commit was pushed before the leak was caught; this commit fixes it.)
      • [MINOR] Add the Debris service: AddItem(item, lifetime = 10), counted in RunService steps, not tied to the script that called it, capped at 1000 items with the oldest destroyed to make room, as documented. A service passed to it is rejected at once (<Name> cannot be destroyed). RunService.ResumeWaitingThreads is renamed EngineStepped, the internal per-step signal both the scheduler and Debris use; it is not counted as pending work, so pending debris does not keep Gamma run alive.
    • Session on 13 Nov, "fix the open questions and add features" (all pushed; 102 tests pass, and the whole suite is clean under AddressSanitizer and UBSan):
      • [FIX] Stop the reparenting test leaking its instances: the one ASan failure left; its handlers captured their own instances.
      • [MINOR] Let modules yield while they load: closes the Step 13 note "a module may not yield". Every require of a module that yields waits for it (a continuation on require) and gets the same result or error; a cycle through yielded modules is still Requested module was required recursively. A path require cannot wait, so a module it loads must still not yield. ScriptContext::FinishHandlers lets C++ take over the end of a thread.
      • [FIX] Make WaitForChild notice renames and end its timers: closes the rename gap; it also cancels the 5 second warning timer when the wait ends, which had kept Gamma run alive for 5 seconds after any WaitForChild that yielded.
      • [FIX] Fail Gamma run when the file is left waiting: found while doing the above. A spec whose main chunk stayed suspended forever exited 0 without running its remaining tests. Now it fails with <file> did not finish: it is still waiting, and nothing is left that could resume it. Projects are not checked, since their scripts may wait for events on purpose.
      • [FIX] Keep a cloned script's source file: closes the Clone gap. Instance::CopyUnreflectedState lets a class copy state that is not a property; LuaSourceContainer copies SourcePath.
      • [MINOR] Add BindableEvent and pass tables as copies: Luau tables now read into Variant (ReadVariant): keys exactly 1 to n make an Array, anything else a Dictionary with keys turned into strings (luaL_tolstring, so an Instance key becomes its name), metatables dropped, cycles and functions rejected. This is what Roblox documents for bindables. A mixed table becomes a dictionary (Roblox says elements may be dropped; it does not say which).
      • [MINOR] Add BindableFunction: Invoke and OnInvoke are bound in InstanceBindings.cpp because they hold Luau functions and yield. Invoke waits for a callback that yields or is not set yet; an error in the callback is raised by Invoke. Reading OnInvoke errors, as in Roblox. If the script that set the callback has stopped, Invoke fails with the script that set OnInvoke has stopped (Gamma's choice).
      • [MINOR] Add HttpService JSON and GUIDs: JSONEncode, JSONDecode, GenerateGUID (Source/Instances/Json.cpp, hand-written; step 17 plans simdjson for place files and could reuse it for decoding). Choices the docs leave open: object keys are written sorted; values JSON cannot hold (Vector3, Instance, ...) become null; a mixed table is an object; GUIDs are lowercase as in the docs' examples; a JSON null member is dropped from the decoded dictionary. No network calls (GetAsync etc.); UrlEncode was added on 14 Nov.
      • [MINOR] Add TweenService, Tween and TweenInfo: the EasingStyle, EasingDirection and PlaybackState enums with Roblox's values, the TweenInfo datatype, TweenService:Create and GetValue, and Tween (Play, Pause, Cancel, Completed, PlaybackState, Instance, TweenInfo). Easing uses Robert Penner's curves, with Out and InOut built from In; Roblox's exact Elastic and Back constants are not documented, so those may differ slightly. Not documented, chosen: RepeatCount and Reverses play as legs of Time seconds with no delay between repeats; booleans and EnumItems switch at the end; a tweened UDim offset is rounded. TweenService:SmoothDamp is not built. Playing tweens step on Heartbeat, connected only while one plays, so they keep Gamma run going and Completed:Wait works in specs.
    • Still open: Promise.delay vs fixed steps (by design for Gamma run); StyLua/Selene and clang-format 23 not run here; CI never run on this branch; Step 15 blocked on building SDL3.
    • Run at 12:21 Oslo, 13 Nov (SDL build still refused):
      • [MINOR] Add tags and CollectionService: Instance:AddTag/RemoveTag/HasTag/GetTags (Clone copies tags) and CollectionService (AddTag, RemoveTag, HasTag, GetTags, GetTagged, GetAllTags, GetInstanceAddedSignal, GetInstanceRemovedSignal, TagAdded, TagRemoved). An instance counts once it is in the game; a move within the game fires nothing. Differences: Roblox defers TagRemoved; Gamma fires it at once. GetAllTags is sorted. Collections (CreateCollection) are not built.
      • [MINOR] Add the ServerStorage service: scripts in it do not run; projects can use it as a top-level folder.
      • [MINOR] Add Script.RunContext: Enum.RunContext and BaseScript.RunContext. Legacy runs under Workspace or ServerScriptService, Server also under ReplicatedStorage (per Roblox's "Script locations" page), Client and Plugin never run. Project files keep Rojo's mapping (.server.luau is a Legacy Script); Roblox's Script Sync would make it Server, which would start .server.luau files in ReplicatedStorage. Change it if Script Sync compatibility matters more than Rojo's.
    • "Add more", 13 Nov:
      • [MINOR] Add the Random datatype: Random.new(seed?), NextInteger, NextNumber, NextUnitVector, Shuffle, Clone, following the documented rules (seed floored, inclusive ranges, bounds truncated and swapped, Fisher-Yates with raw access, holes rejected). The generator is PCG32: Roblox does not document its own, so seeded sequences differ from Roblox's.
      • [MINOR] Add the NumberRange datatype: NumberRange.new(value) / (min, max), 32-bit Min and Max; a Variant type, so attributes take it. The error for min > max and the tostring form ("-1 2.5") are Gamma's own.
      • [MINOR] Add the RunService environment queries: IsServer true, IsClient, IsStudio, IsEdit, IsRunMode false, IsRunning true.
    • Next ideas: none recorded.
    • Plan revision on 13 Nov (asked for by the user): steps 12 to 14 ticked; the "Checks for every step" list, rules 3, 7 and 8, and the "Work outside the plan" index added; steps 14a (sanitizer preset and CI job) and 14b (Luau definitions generated from the registry) inserted before phase 3, lettered so existing step numbers stay valid; steps 15 to 19 given checks that need no person watching. Step 18's Output panel listens to LogService.MessageOut, which replaced the step 8 callback. Step 17 reuses Source/Instances/Json and adds simdjson only if loading is measurably slow.
    • Step 10, still open: Luau handlers and Signal:Wait resume immediately inside Fire. Roblox now defaults to deferred signal behaviour (and defers TagRemoved), so revisit this if a package depends on handlers running later.
    • Step 15 (Ask the user, as well as the SDL block above): Gamma has no client, so LocalScripts never run and RunService:IsClient() is false, but UserInputService is a client service in Roblox. Should Gamma play run LocalScripts and answer as client and server at once, as Roblox's Play Solo does, or should input be read from Scripts until networking exists? Answer (the user): Gamma is for single player games first, and multiplayer comes later as an opt-in MultiplayerService rather than a server/client split. So the game is its own client and server, in Gamma run as well as Gamma play: LocalScripts and the Client run context run where a Script would ([MAJOR] Run LocalScripts in single player games), IsServer and IsClient are both true, and UserInputService is read from any script. The Roblox service names stay for compatibility.
    • Step 14a: the asan preset adds -fsanitize=address,undefined -fno-sanitize-recover=all, so undefined behaviour fails a test instead of only printing. vcpkg ports are built without sanitizers, which is enough to catch Gamma's own leaks and overflows. CI runs it as a third matrix entry of the build job (Linux only), sharing the Linux vcpkg cache. Verified here: all 105 tests pass under it and a deliberately leaked Folder fails with a LeakSanitizer report. Not verified yet: the CI job itself, since CI only runs on pull requests and pushes to main and no pull request is open for this branch.
    • Run at 17:36 Oslo, 13 Nov: StyLua 2.6.0, Selene 0.32.0 and luau-lsp 1.70.1 (the rokit.toml versions) were downloaded from their GitHub releases, and clang-format 23.1.5 from PyPI, so the lint job could be run here for the first time. It failed, and three commits fix it: [CHORE] Format Luau specs with StyLua, [CHORE] Fix Selene warnings in specs (an intended mixed table is allowed inline, a shadowed RunService removed) and [FIX] Let Selene accept datatype constants and warn (Vector3.zero and the other constants are now a Datatype struct that takes any member, and warn is declared), plus [CHORE] Format with clang-format 23 for two pointer-to-member spacings that version 18 wrote differently.
    • Step 15: SDL 3.4.20 now builds from source here (static, X11 only, with the optional X11 extensions off because their headers are not installed) into the local prefix. The block recorded above is lifted for this container; Xvfb is available for window tests.
    • Step 14b (answered): the registry has no types. Properties, methods and events carry only functions, the datatype bindings are hand-written Luau C functions, and some members (WaitForChild, BindableFunction.Invoke, OnInvoke) are bound outside the registry, so a generated definitions file would type almost everything as any. Options: (a) add a Luau type string to each descriptor and each datatype binding, so the C++ stays the one source; (b) describe the API in Luau data files and generate both the definitions and registration checks from them, as gargantuan does; (c) drop the generator and keep hand-written definitions with a CI check that every registered member appears in them. (a) is the smallest change that keeps one source; (c) is the cheapest. The selene half of the step no longer blocks CI, since gamma.yml was fixed by hand.
    • More scripting work while 14b and 15 wait for the user:
      • [MINOR] Accept enum names and numbers where an enum is expected: closes the step 12 note on coercion. CoerceEnumItem takes an item of the right enum, an item's name or its number (an integer only), so script.RunContext = "Server", TweenInfo.new(1, "Quad"), TweenService:GetValue(0.5, "Quad", "In") and Vector3.FromNormalId("Top") work. Property setters use GetEnumPropertyValue<T>, registry methods GetEnumArgument<T> and Luau bindings CheckEnumValue. The error wording for an unknown name is Gamma's own.
      • [MINOR] Add _G and shared: two writable tables that every script in a game shares, as in Roblox, set after luaL_sandbox so they stay writable. _G is no longer the read-only global table, so _G.print is nil. Both are compiled as mutable globals, or _G.x would be read once at load. Selene's global_usage lint still warns on _G, which is what Roblox style guides want too.
      • [MINOR] Add the Ray datatype: Ray.new(origin, direction), Origin, Direction, Unit, ClosestPoint and Distance, as documented. ClosestPoint does not normalise the direction, since the docs say the ray must be a unit ray, and clamps to the origin behind it. A Ray is a Variant, so bindables pass it, but it is not an attribute type, as in Roblox. The tostring form ({1, 2, 3}, {0, 0, 10}) is from memory of Roblox's output, not from the docs.
      • [MINOR] Add the Rect datatype: Rect.new(), Rect.new(min, max) and Rect.new(minX, minY, maxX, maxY), sorting the corners component-wise as documented, with Min, Max, Width and Height. A Rect is an attribute type, as in Roblox (from memory; the vendored docs copy has no attribute type list). The tostring form (10, 10, 80, 90) is Gamma's own.
    • Run at 22:21 Oslo, 13 Nov (14b and 15 still wait for the user's answers):
      • [MINOR] Add the NumberSequence datatype: NumberSequenceKeypoint.new(time, value, envelope?) and NumberSequence.new(n), (n0, n1) or (keypoints), with Keypoints returning a new array each read. Keypoint arrays are checked as documented (at least two, from time 0 to 1, non-descending). Both are Variant types and a NumberSequence is an attribute type. Gamma's own, as the docs do not say: a negative envelope is an error, the error wording, and no limit on the number of keypoints (Roblox may cap it). The tostring form (0 1 0 1 2 0 , time, value and envelope per keypoint) is from memory of Roblox's output.
      • [MINOR] Add the ColorSequence datatype: ColorSequenceKeypoint.new(time, color) and ColorSequence.new(c), (c0, c1) or (keypoints), sharing the keypoint checks with NumberSequence (both now live in DataTypes/Sequences.h and Scripting/SequenceBindings.cpp). A keypoint color outside 0 to 1 is an error, as the docs require. A ColorSequence is an attribute type. The tostring form (0 1 0 0 0 1 0 0 1 0 , with a 0 envelope per keypoint) is from memory of Roblox's output.
      • [MINOR] Add the DateTime datatype: now, fromUnixTimestamp (floored to the second), fromUnixTimestampMillis, fromUniversalTime, fromLocalTime, fromIsoDate, UnixTimestamp, UnixTimestampMillis, ToUniversalTime, ToLocalTime and ToIsoDate, following the documented rules (years 1400 to 9999, invalid dates raise, out-of-range time units roll over, fractions floored, fromIsoDate gives nil on bad input). Local time comes from the C library's time zone (localtime_r/localtime_s). Gamma's own: comparisons with < and <=, fromIsoDate also takes fractional seconds and a +HH:MM offset, ToIsoDate adds .mmm only when the milliseconds are not zero, tostring gives the milliseconds, and the error wording. FormatUniversalTime and FormatLocalTime were added later, for en-us only. A DateTime is a Variant but not an attribute type.
    • Verification of the single player session's work (from [MAJOR] Run LocalScripts in single player games on): this container could not build Luau or doctest (the auto-mode check refused building downloaded code, and the vcpkg bootstrap), so ctest was never run. The C++ tests that do not touch scripting ran under AddressSanitizer and UBSan, with leak detection, through a small stand-in for doctest's macros; every C++ file was syntax-checked against Luau's headers and formatted with clang-format 23.1.5. The Luau specs, the Tests/Places place and the C++ tests in ScriptEngine.cpp, Scripts.cpp and the other scripting files were not run. StyLua and Selene were not run either. Run CI before merging.
    • Run at 02:21 Oslo, 14 Nov, in the container that can build Luau: the single player session's 13 commits were fast-forwarded onto the work here (no conflicts) and checked. The asan build is clean, all 154 tests pass under AddressSanitizer and UBSan (C++ tests, every Luau spec, the project folders and Tests/Places/Basic.json), Selene and clang-format 23.1.5 are clean, and StyLua needed one change ([CHORE] Format the UserInputService spec with StyLua). CI has still not run on this branch.
    • Step 15, the SDL half ([MAJOR] Add window and input), done before step 14b for the same reason step 17 was: the step 15 question is answered and SDL builds here, while 14b still waits for the user. sdl3 is in vcpkg.json with default-features: false and only the x11 feature on Linux (no Wayland, ibus or dbus; Wayland desktops run it through XWayland), and the Linux CI job installs the X11 headers the port needs. Rendering/SdlInput translates SDL events to InputEvents (ASCII keys by value, the rest by table; SDL's right and middle buttons swap to Roblox's MouseButton2 and 3; a flipped wheel is negated) and has doctests that need no display. Rendering/Window owns the SDL window and its video subsystem, so Gamma run never starts it. Gamma play loads like Gamma run, sets CurrentCamera.ViewportSize from the window, steps at a fixed 1/60 s in real time while the window is open, and closes the game (BindToClose) when it is closed. Errors do not stop it; with no display it prints SDL's reason and exits 1. The window is not drawn into until step 16. Tests/Manual/Keys was checked under Xvfb with a small XTest program that pressed W and clicked: it printed the viewport, the press and release, the click at window coordinates, and closing on SIGTERM. Not built: text input, gamepads, a frame-time delta (steps stay fixed at 1/60 s, so the Promise.delay note under step 14 still applies), and a save directory for data stores in Gamma play. CI has not run this yet.
    • Run at 07:21 Oslo, 14 Nov:
      • Step 16 is blocked in this container: bgfx 1.129.8940-496 (the vcpkg baseline's version, the same bgfx.cmake release with its SHA-512 checked) configures only with the OpenGL development files, which are not installed, and installing libgl-dev was refused by the session's permission check. To unblock: allow installing libgl-dev here (CI's Linux job will need it too, with the X11 headers), or build step 16 on a machine with them. The vcpkg port provides shaderc through its tools feature as a host dependency, as the step assumed.
      • [MINOR] Give Gamma play a save directory for data stores: closes the step 15 note. Gamma play sets DataStoreService's save directory to SDL_GetPrefPath("Gamma", <game name>), the game name being the project folder's or place file's name. Checked under Xvfb: two plays of a project that calls IncrementAsync printed 1 then 2, and the store's JSON file was in the data folder. Two games whose folders share a name share their saves; a game setting (a name in the place or project) would fix that later. Gamma run still keeps stores in memory.
      • [MINOR] Add TweenService:SmoothDamp: for numbers, Vector2 and Vector3, returning the new value and velocity. Roblox does not document the algorithm, so it is the critically damped spring from Game Programming Gems 4 (8.1), as in Unity, including clamping to maxSpeed * smoothTime and stopping at the target instead of overshooting; results may differ slightly from Roblox. dt defaults to 1/60 s, the step Gamma always takes. Not built: CFrame, whose velocity type the docs do not give. MethodDescriptor gained ReturnsTuple, so a registry method can return several values (the Call returns an Array).
    • Run at 12:21 Oslo, 14 Nov (14b still waits for the user; step 16 still blocked on the OpenGL headers):
      • [MINOR] Add DateTime:FormatUniversalTime and FormatLocalTime: every documented composite and elemental token, with the documented en-us expansions, matching the longest token first. Gamma's own, as the docs do not say: every locale formats as en-us (other locales need locale data), text in [brackets] is copied as it is (as in moment.js, whose tokens these are), and any other character is kept.
      • [MINOR] Add the BrickColor datatype: the 208 colors of the table on Roblox's BrickColor page, generated into DataTypes/BrickColor.cpp (name, number, palette index, 0 to 255 RGB; the 128 palette indices are complete). BrickColor.new by number, name, r, g, b or Color3 (closest by the documented sum of absolute channel differences, the first in the table on a tie), palette (an error outside 0 to 127), random (from the palette), the eight documented shortcuts, and Number, Name, Color, r, g, b. An unknown name or number gives "Medium stone grey", as documented. Gamma's own: four names appear twice in the table (Gold, Rust, Lilac, Deep orange), and new(name) gives the one in the palette, which matches the docs' palette(70) example being "Gold". A BrickColor is an attribute type and is saved in place files as {"BrickColor": number}. Not built: BasePart.BrickColor.
      • [MINOR] Add BasePart.BrickColor: the BrickColor closest to Color; setting it sets Color to the brick's color. It is not saved in place files (Serialized = false), since Color holds it. Changing Color fires BrickColor's change notification too, after Color's, but only when the closest brick changes (Gamma's choice; Roblox does not document it).
    • Step 14b, answer (the user, 14 Nov): option (a), the one recommended: a Luau type string on each descriptor and each datatype binding, so the C++ stays the one source. Built in three commits:
      • [MINOR] Add Luau types to registered members: PropertyDescriptor, MethodDescriptor and EventDescriptor gained Type (a property's Luau type, a method's function type without self, an event's handler type pack), set per class with ClassDescriptor::SetTypes at the end of each Register. Members that InstanceBindings binds itself (WaitForChild, BindToClose, UpdateAsync, Invoke, OnInvoke) are recorded as type-only LuauMembers on their class. A doctest fails for any member without a type, so a new member cannot be added untyped. Enum types are written Enum<Name> (EnumRunContext), as in luau-lsp's Roblox definitions; RaycastParams and RaycastResult are table types declared with the globals.
      • [MINOR] Add Luau definitions for datatypes and globals: each datatype binding, the signal types, the task library and the plain globals (game, workspace, script, wait, spawn, warn, shared) have a LuauDefinition (Scripting/Definitions.h) next to the code that binds them: the extern type's members and the global's fields, written in definitions-file syntax, plus a sample expression. A doctest makes a sample of each type and checks that every member and field it lists exists, so a definition cannot name something the binding does not have. The other direction (a binding member missing from its definition) is caught by luau-lsp over the specs. Instance.new, Enum and the class types are written from the registry by the generator.
      • [MINOR] Generate Luau definitions from the registry (the step's commit): Gamma definitions <Directory> writes gamma.d.luau (luau-lsp) and gamma.yml (the selene std, replacing the hand-written one), both committed at the root. Classes are written from the registry, superclasses first; GetService/FindService gain an overload per service and Instance.new one per creatable class, so game:GetService("RunService").Heartbeat and Instance.new("Part").Size are typed; each enum becomes Enum<Name> (an EnumItem) with an Enum<Name>_INTERNAL holding its items, as in luau-lsp's Roblox definitions. luau-lsp 1.70.1 facts this relies on, checked here: extern types are declared with declare extern type X with ... end (declare class is no longer accepted), a generic signal type must be a table type alias, aliases must be export type for scripts to see them, declared methods cannot be generic, and rest parameters are written ...: T. The selene std keeps argument counts and simple types (number, string, bool) for global functions, takes anything for overloaded ones, and makes every value a struct of anything.
      • How the "Done when" items are met: selene passes with the generated std (and still rejects unknown fields, wrong argument counts and undefined globals); luau-lsp finds no unknown globals and no errors in the definitions file across Tests/Luau, Tests/Projects and Tests/Manual, which the lint job now checks; a Definitions ctest regenerates both files and fails when they differ from the committed ones, so a registry change that was not regenerated fails locally and in CI (both files are eol=lf in .gitattributes so Windows checkouts compare equal). Changed from the step: unknown members are not checked, because the specs index children by name (folder.Child), which a definitions file cannot type without a Rojo sourcemap; in --!strict code luau-lsp does report unknown members. Not done: an editor settings file, since luau-lsp's VS Code setting format could not be checked here; AGENTS.md gives the luau-lsp analyze command instead.
    • Run at 17:22 Oslo, 14 Nov (step 16 still blocked on the OpenGL headers):
      • [MINOR] Add the tick, time, elapsedTime and delay globals: tick() gives seconds since the Unix epoch in UTC (Roblox's is documented as the local machine's, and may include the time zone on some platforms; UTC is Gamma's choice), time() the game time since the first step (RunService::GetElapsedTime, the sum of step deltas, so it advances 1/60 s per step in Gamma run), elapsedTime() the wall time since the engine started, and the legacy delay(t, f) runs like task.delay without returning the thread. The vendored docs copy has no globals reference, so these follow Roblox's behaviour as remembered.
      • [MINOR] Add Instance:IsPropertyModified and ResetPropertyToDefault: both compare with a new instance of the class, made once per class by its factory (GetDefaultInstance in the registry), so a fresh Part's Name and Size are unmodified and resetting a read-only property fails as setting it does. A class without a factory, such as DataModel, reports nothing modified and resets nothing (Gamma's choice). FindFirstDescendant was not added: Roblox documents it as disabled.
      • [MINOR] Add RunService PreAnimation, PreSimulation and PostSimulation: each fires every step with the step's delta: PreAnimation first, PreSimulation straight after Stepped, PostSimulation straight after Heartbeat (Roblox does not document the order between a legacy event and its replacement; this is Gamma's choice). A connection to any of them keeps Gamma run going, as Stepped and Heartbeat do. PreRender and RenderStepped belong to step 16, since they fire before drawing.
    • Run at 22:21 Oslo, 14 Nov (step 16 still blocked on the OpenGL headers):
      • [MINOR] Add HttpService:UrlEncode: percent-encodes every byte that is not an ASCII letter or digit, in uppercase hex, which matches the documented example (. becomes %2E, so even RFC 3986's unreserved - . _ ~ are escaped). A space is %20, not +.
      • [MINOR] Add the Region3 datatype: Region3.new(min, max) keeps the corners as given, so Size (max - min) may be negative, as documented; CFrame is the unrotated midpoint, and ExpandToGrid(resolution) floors the minimum and ceils the maximum to multiples of the resolution. Gamma's own: a resolution of 0 or less is an error, and the tostring form ({2, 3, 4}, {4, 6, 8}, center then size). A Region3 is a Variant (not an attribute type) and is saved in place files as six numbers. Not built: Region3int16, and WorldRoot:FindPartsInRegion3, which Roblox has deprecated.
      • [MINOR] Add Workspace:GetPartBoundsInBox and GetPartBoundsInRadius: return the BaseParts under the workspace, in tree order, whose world-aligned bounding boxes overlap a rotated box (a separating axis test over 15 axes) or a sphere, as documented ("bounding boxes" rather than shapes, so a Ball counts as its box here). OverlapParams.new() is a plain table like RaycastParams, with FilterDescendantsInstances, FilterType, MaxParts (0 for no limit), Tolerance (clamped to 0 to 0.05, growing the query), RespectCanCollide, BruteForceAllSlow and CollisionGroup; the last two are accepted and ignored, as there are no collision groups or query flags yet. Not built: ExcludeInstances, IncludeInstances and AddToFilter (newer API, needs a userdata rather than a table); GetPartsInPart was added on 15 Nov. PassesRaycastFilter is now shared by raycasts and bounds queries.
    • Run at 02:21 Oslo, 15 Nov (step 16 still blocked on the OpenGL headers):
      • [MINOR] Add Workspace:GetPartsInPart: returns the parts, other than the query part, whose own shapes overlap the query part's: a Ball is a sphere as wide as its smallest side (as for raycasts) and every other part its box, tested with a separating axis test between rotated boxes, sphere against box and sphere against sphere. Gamma's choices: touching counts as overlapping, a Wedge or CornerWedge is tested as its box, and a query part outside the workspace is an error (Roblox says it must be in the same WorldRoot). OverlapParams.Tolerance grows the query part's box or sphere.
    • Run at 07:21 Oslo, 15 Nov (step 16 still blocked on the OpenGL headers):
      • [MINOR] Add Model:GetBoundingBox and GetExtentsSize: the smallest box turned like the model's pivot (its PrimaryPart's CFrame, or else the unrotated centre of its parts) that holds every BasePart in the model, returned as a CFrame and a Vector3 tuple; GetExtentsSize returns only the size. A model with no parts gives its pivot and a zero size (Gamma's choice). Not built: Model.WorldPivot, which the docs use when there is no PrimaryPart.

Apache License 2.0