Commit graph

7 commits

Author SHA1 Message Date
Admin
86cd0604ef libs: no warnings in the workspace check on any row -- the CI box checks every package on every target, and the library crates, which have no tile of their own, warned on the rows nobody builds by hand. On wasm and mobile, things are gated with their users: the workspace document worker (its commands, payloads, retry constants and Drop are native; the wasm API stays, behind an uninhabited worker whose constructors answer that the browser has no document worker), the hub's unused non-Unix available_bytes and its ram facts parser, the loader's ArenaPtr, system_speech's bcp47. On the tvOS rows, the only ones built on nightly, the legacy numeric constants and functions become the associated constants they have been since Rust 1.43 (micro_serde, bytemuck, rustybuzz, unicode-script, smallvec, weezl); fetch_update keeps its name under allow(deprecated) in stitch, git and the map archive, since try_update does not exist on older stable toolchains; objc-sys declares free with the signature the standard library uses; rustybuzz calls its own method through a path that a future std method of the same name cannot shadow; and the Script derive's unused helper attribute splat, which nightly now reserves as a built-in, is spelled script_splat (nothing in makepad, Scope or Stage uses it)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 00:02:28 +02:00
Admin
9788b827eb tests: the workspace suite, run as a whole for the first time, passes outside the example UI tests -- each failure was settled from history as a stale test or a regression. Stale, expectation updated to the change that overtook it: draw's road pack tests fed a z-bias tick outside the exact f16 range; network no longer reserves Accept (906f94a94); the log ring test waits for the asynchronous sink (2e27ce2ff) and the audio tap test no longer assumes it owns the shared registry; xatlas compares the irregular oracle within the official tool's float precision instead of bit for bit; xr's four-wheel car exposes the chassis query plus one per wheel (080794781) and the depth mesh plan follows the 0.32 m chunk (ddec6fc60); score's DSL test sets up the OS context clock it reaches; hello_world's GIF test describes the fixture that is actually embedded. Regressions, code fixed: the tweaker could not print layout enums as whole values because the derive never emitted the __enum companion it looks up; the workspace style picker never learned about the Black orange style put at the front of DesktopStyle::ALL, and per the decision that Black orange is not offered in pickers it lists ALL without it, maps indices accordingly and loads a stored "blackorange" without a selection; xr's car controller no longer scales engine force by 1/dt a second time (same force at the fixed step) and a scaled vehicle's suspension is stiff enough to carry it at its shortened rest length. The two xr tests that need a local-only reference dump (xr/dump is git-ignored) say so and return
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 23:41:03 +02:00
Admin
eafc15da62 workspace: Scope's settings carry the code map's tab width and the directories each prepared project hides from its map
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 01:49:29 +02:00
Admin
2522a19e4f libs: sqlite WITHOUT ROWID reads, an in-repo tar reader, packed git imports, a Haskell lexer, and the AI crate warning cleanup
libs/sqlite_query reads WITHOUT ROWID tables through the index cursor,
refuses to write them, and the pager releases its process write slot on
drop. libs/tar is an in-repo tar reader with gzip through fast_inflate.
libs/git imports packed objects with bounded checkout writers and its
HTTP file responses carry a trailer. libs/code_language gains a Haskell lexer with literate (Bird) dialect
detection. libs/loader_bundle and libs/search are new;
libs/app_module carries the super-app module surface; libs/workspace
adds Settings.infinite_zoom and RendererChoice::gpu_env_value; libs/ai
builds without warnings across the hub, llm, metal and model crates;
windows-rs job object handles are c_void.

Squashed from work (the libs parts of each):
- Restore retained renderer support for Scope (libs/search)
- Share Builder target across Makepad app builds (libs/loader_bundle)
- Index local Apple Mail with Gmail labels, attachments and reimport (libs/sqlite_query)
- libs/ai: warning cleanup across the hub, llm, metal and model crates
- code_language: a Haskell lexer with literate (Bird) dialect detection
- git: packed imports and bounded checkout writers; HTTP file responses carry a trailer
- builder: dedicated-folder installer checks, catalog and runtime fixes; Windows job objects hold c_void handles (libs/windows)
- workspace: Settings.infinite_zoom, the experimental prepared map inside the glyph
- wm: the Android super-app hosts apps as on-demand dylibs (libs/app_module)
- libs/tar: an in-repo tar reader; the super-app unpacks its archives with it
- workspace: RendererChoice::gpu_env_value follows the platform's runtime GPU choice

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 12:15:55 +02:00
Kevin Boos
bc8c37357a Choose the Linux GPU backend at runtime, and make Vulkan the default (#1237)
* Choose the Linux GPU backend at runtime and pace Wayland frames adaptively

A Vulkan-capable desktop Linux build (the `vulkan` feature, or
`MAKEPAD=vulkan`) now carries OpenGL ES as well and picks between them
when its event loop starts: Vulkan on Wayland when a hardware device
answers, OpenGL ES when none does (no driver, only a software rasterizer,
or an X11 session). `MAKEPAD_GPU=auto|gl|vulkan` overrides the choice, and
`MAKEPAD=gl` still produces an OpenGL-only binary. The feature stays
opt-in: the hosted (`--stdin-loop`) and direct renderers of such a build
are Vulkan-only, and Vulkan has no video texture import yet.

Wayland frame pacing
- Pace presents by what the backend and the session can actually do,
  rather than by a fixed number (new `wayland/frame_pacer.rs`). Vulkan
  runs two presents in flight only when the compositor offers `fifo-v1`
  and the driver uses it; otherwise a second present would block inside
  `vkQueuePresentKHR` on a callback an occluded window never receives.
  OpenGL starts the next frame early only when its measured cost says the
  swap would land after the outstanding callback is due, so cheap frames
  are not committed twice per refresh. One present in flight, which is
  what this did before, left a heavy scene at half the display rate.
- Bound the pacing gate at 250 ms so an occluded window cannot freeze the
  app's clocks, and let pending screenshot requests through it.
- Treat WouldBlock on the display flush as transient.

Vulkan
- Bound the frame fence wait and the swapchain acquire on Linux instead of
  waiting forever.
- Keep the per-frame packet arena mapped, recycle completed frame
  resources on the window path, and ask for one more swapchain image on
  Linux, where the pacing can keep two presents queued.
- Skip CPU devices unless `MAKEPAD_GPU=vulkan` asks for Vulkan explicitly.

OpenGL
- Stop repainting forever at rest: poll the texture lifetime fence once
  per frame, and check for time-driven shaders only after the
  zero-instance skip, as Vulkan does. The explicit
  `Cx::frame_completion_serial` poll still always arms a fence.
- Upload draw-call uniforms only when they changed; they were uploaded
  twice per draw call per frame. A zbias shift now marks them dirty, so a
  call skipped that frame still uploads when it next draws.
- Compute the retained-instance upload plan once per buffer per frame; it
  was computed three times.
- Target remote screenshot requests at the presenting window. Every
  `--remote` grab timed out on OpenGL before this.
- Emit the `gpu.present` trace with render and swap timings.

Retained instances
- `upload_plan` settles segments that kept their slot and offset by `Arc`
  identity, scans for the first few that moved, and only then builds a
  pointer-keyed map. On a large map this took a plan from 0.3-1.5 ms to
  about 0.07 ms. Results are identical to the previous planner.
- Add `collect_backlog` so a renderer can drain retirements once a frame.

Runtime backend consistency
- `CxOs::vulkan_active()` replaces the compile-time branches that decided
  between the two renderers, so a build that fell back to OpenGL releases
  its uniform buffers, shares host swapchains and retires textures the way
  an OpenGL build does.

Wayland teardown
- Drop windows before the `Connection`, and destroy a window's EGL surface
  and `wl_egl_window` before its `wl_surface`. Every OpenGL exit on
  Wayland segfaulted inside NVIDIA's egl-wayland.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Make Vulkan the default on desktop Linux, with mipmaps and hosted fallback

Every desktop Linux binary now carries both renderers and picks at startup,
instead of only the apps that asked for Vulkan by name. Three things had to
be true first.

Gate the feature where the fallback exists. build.rs derived `use_vulkan`
from `target_os == "linux"` alone, which also matches OpenHarmony and every
other Linux triple, none of which carry `naga`, and it ignored
`MAKEPAD=linux_direct`, whose DRM/KMS renderer has no OpenGL fallback of its
own. The feature now only reaches x86_64/aarch64 gnu windowed builds;
`MAKEPAD=linux_direct+vulkan` remains the way to ask for direct Vulkan.

Give Vulkan a mip chain. `image_cache_use_mipmaps` was off for Vulkan
because the uploader only ever filled level 0, so every minified image
aliased. Images now allocate their full chain and fill levels below the
first with `vkCmdBlitImage`, the way `glGenerateMipmap` does, skipping
formats the device cannot linearly blit. On Robrix's sign-in icons this
takes Vulkan from 2153 pixels differing from the OpenGL render by more than
8, to 400.

Choose the hosted renderer at runtime too. `--stdin-loop` mode was
Vulkan-only in a Vulkan-capable build and panicked when no device answered,
while its host, on an X11 session, had already fallen back to OpenGL: with
the feature on by default that combination would have killed every child the
wm launches. The hosted path now selects the way the windowed one does, its
import follows the renderer the process actually started, and a hosted child
rejects software devices for the same reason a window does.

Video and `Texture::read_back` are still OpenGL-only; the video error now
names `MAKEPAD_GPU=gl`, and the feature comment says so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* workspace: drop the renderer-routing argument and its build-time wording

One desktop Linux binary now carries both GPU backends and picks at startup,
so an app honouring a saved renderer choice passes it to the platform as
MAKEPAD_GPU and restarts itself. Nothing produces `--renderer-routed` any
more; an argument this parser does not know was already ignored, so dropping
its arm changes nothing for anyone still passing it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Keep the shared Android and direct-display paths as they were

An audit of what this branch reaches on platforms that share these files
found five places where it changed behaviour it was never meant to touch.
All of them come from code this branch made runtime-selected or relaxed.

Mipmaps are desktop Linux only, matching `image_cache_use_mipmaps`, which
is what asks for the format. An Android or Quest Vulkan build shared the
new chain code and would have allocated levels and recorded blits that
nothing there requests and nothing measured.

The mip chain also needs more of the format than it asked for. It checked
only that the format samples linearly, while `record_mip_chain` blits
between levels, so it now requires BLIT_SRC and BLIT_DST too and keeps a
single level otherwise.

Shader compilation stays a compile-time answer off desktop Linux. Whether
a draw shader is compiled to SPIR-V became a runtime `vulkan_active()`
test, which on Quest would follow an Android Vulkan init failure instead
of the build. Only desktop Linux has that fallback.

The hosted loop compiles GLSL only when OpenGL is the renderer. Losing its
cfg left it calling `gl()` in a Vulkan hosted child, which has no EGL
context, so it panicked. Its Wayland sibling already guards this way.

The direct display build keeps its software-buffer upload. `texture_for_draw`
gained a `not(linux_direct)` that was never needed: `MAKEPAD=linux_direct`
without Vulkan has its own `upload_presentable_image_software_buffer` in
os/linux/presentable.rs, and the outer gate already excludes the direct
Vulkan build.

Also: `gpu_preference` is now gated exactly where its caller is compiled,
since `vulkan_linux.rs` builds for every `target_os = "linux"` under
`use_vulkan`, and the hosted loop's imports follow the block that uses
them, which the direct Vulkan build does not compile.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 12:14:30 +02:00
Admin
a67096d20b platform: the retained renderer for Scope, the vulkan cargo feature and Cx::gpu_backend()
Retained renderer support is back for Scope on Metal, Vulkan, OpenGL,
WebGL and the simulated GPU. A `vulkan` cargo feature picks Vulkan on
desktop Linux, Cx::gpu_backend() names the compiled GPU API, and the
direct WM builds again. Settings.renderer in libs/workspace keeps the
saved GPU API choice (Vulkan | OpenGL) behind the --renderer-routed
argument. The Android build keeps the texture alloc types imported for
OES adoption, and that import stays off the web build. The simulated
GPU builds on Linux again.

Squashed from work, without the cargo vendor snapshot the retained
renderer commit carried there:
- platform: a `vulkan` cargo feature picks Vulkan on desktop Linux; Cx::gpu_backend() names the compiled GPU API; the direct WM builds again
- workspace: Settings.renderer — the saved GPU API choice (Vulkan | OpenGL) and the --renderer-routed argument
- Restore retained renderer support for Scope
- platform: Android builds again — the texture alloc types stay imported for OES adoption
- platform: the Android texture-adoption import stays off the web build
- platform: the simulated GPU builds on Linux again

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 12:14:21 +02:00
Admin
3811545d48 apps: director, studio, scope, aichat
Squash of 8 work commits (Sep 2–10):
  7b9ed2c  aichat: the assistant as an app — the panel owns the engine, the bus client, settings with the local-only lock
  e0c6e74  aichat: the progress bar and system lines use the theme's highlight colour
  8b46ce0  aichat: the composer's hint is a dark grey Ask AI, not the typed colour
  b99a631  toml_parser, rust_tokenizer: rewrite both for the code analyser
  3bbcea2  aichat: add Studio evaluation-feedback widget
  b61845f  studio: Architecture view, the third workspace mode
  d7a76cf  studio: add bounded code context and source APIs
  524142a  Split Studio into makepad director (public) and makepad scope (private)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 13:40:29 +02:00