Delete the decisions and design logs; scripts, rigs and xtask off the root
Iris: "remove both decisions and iris.md. I've decided to instead make decisions when planning with agents rather than after they do things, and they're both too long for me to wanna read, + don't cover all the decisions I'll wanna make about the code anyways. I'll just naturally run into things for now. Todo is important though." So docs/DECISIONS.md (850 lines) and docs/IRIS.md (1,986) are gone, and AGENTS.md now says not to start another: raise a choice while planning it with her, otherwise decide it and put the reasoning at the code it governs. The TODO lists stay. docs/SUBAGENTS_DECISIONS.md went with them -- same artefact, same reasoning, and she did not name it, so its six decisions were folded into docs/SUBAGENTS.md rather than deleted. Deleting the logs left ~30 citations dangling in code comments and docs. Each states its reason inline and cited the file only for provenance, so they now read "decided 2026-09-07" or name the module doc that carries the reasoning. The root had six things that were not a program or a document. Moved, per "I only meant top level sh files": run-tests.sh, test-wg-tunnel.sh, wg-setup-host.sh -> scripts/ rigs/ -> scripts/rigs/ xtask/ -> scripts/xtask/ A project's own scripts stayed with the project: app/*.sh, app-rust/*.sh, iris/*.sh and server/enroll-link.sh did not move. `target/` at the root is deleted and cannot come back: there was never a workspace there, and the 29 MB was only xtask's scratch space, now in scripts/xtask/target/. `cargo xtask apk` still runs from the repo root and now publishes to scripts/build/outputs/apk/<mode>/ -- one directory deep, because that is what Dev Updater's `*/build/outputs/apk/*/*.apk` discovery pattern needs, and scripts/xtask/build would have been two. Verified: ./scripts/run-tests.sh and `cd iris && cargo test` green, clippy and fmt clean everywhere, `cargo xtask apk debug --abi x86_64` builds and signs an APK carrying lib/x86_64/libai_app.so at the new publish path, and the repo root is now eleven entries with no build output among them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09778346a0
commit
4ccfda6b8e
44 files changed
+198
-2994
No files matched your search
@@ -0,0 +1,102 @@
|
||||
//! Why a GPU test segfaults *after* it has passed, and what stops it.
|
||||
//!
|
||||
//! Measured here 2026-09-08, on this VM's Venus adapter. Destroying the
|
||||
//! last `VkInstance` makes the Vulkan loader `dlclose` the ICD; Mesa's
|
||||
//! ICD (`/usr/lib/libvulkan_virtio.so`) registers a `pthread_key_create`
|
||||
//! destructor pointing into its own text and is not linked `-z nodelete`,
|
||||
//! so glibc calls that destructor through unmapped memory when the thread
|
||||
//! that used Vulkan exits. libtest runs every `#[test]` on a spawned
|
||||
//! thread, which is why it looked like "wgpu crashes on drop": the drop
|
||||
//! itself completes, and the crash lands as the thread unwinds.
|
||||
//!
|
||||
//! The four modes are the experiment, and each is one variable:
|
||||
//!
|
||||
//! | mode | what it does | 2026-09-08 |
|
||||
//! |---|---|---|
|
||||
//! | `main` | wgpu instance + device on the main thread, dropped | exits 0 |
|
||||
//! | `thread` | the same on a spawned thread | **SIGSEGV** |
|
||||
//! | `keep` | the same, but the instance is never dropped | exits 0 |
|
||||
//! | `raw` | raw Vulkan (`ash`), instance + device, spawned thread | **SIGSEGV** |
|
||||
//!
|
||||
//! `raw` is the one that says whose bug it is: no wgpu is involved, so
|
||||
//! there is nothing for wgpu or a caller to fix in its drop order. `keep`
|
||||
//! is the fix -- hold one `wgpu::Instance` for the process, which is what
|
||||
//! wgpu asks for anyway. `iris/tests/mask_sdf.rs` does exactly that.
|
||||
//!
|
||||
//! `VK_LOADER_DISABLE_DYNAMIC_LIBRARY_UNLOADING=1` also makes every mode
|
||||
//! exit cleanly, which is the confirmation that the unload is the
|
||||
//! mechanism -- but it is an environment variable every caller would have
|
||||
//! to remember, so it belongs in this comment rather than in a script.
|
||||
|
||||
use ash::vk;
|
||||
use pollster::block_on;
|
||||
use wgpu::*;
|
||||
|
||||
fn main() {
|
||||
let mode = std::env::args().nth(1).unwrap_or_else(|| "thread".into());
|
||||
let body = match mode.as_str() {
|
||||
"main" => return wgpu_open_and_close(false),
|
||||
"thread" => || wgpu_open_and_close(false),
|
||||
"keep" => || wgpu_open_and_close(true),
|
||||
"raw" => raw_vulkan_open_and_close,
|
||||
other => panic!("unknown mode {other:?}: main | thread | keep | raw"),
|
||||
};
|
||||
std::thread::spawn(body).join().expect("the spawned thread");
|
||||
// Not reached when the thread's exit takes the process with it.
|
||||
eprintln!("thread joined");
|
||||
}
|
||||
|
||||
/// A wgpu instance and device, opened and closed. `keep_instance` is the
|
||||
/// fix under test: everything else still drops normally.
|
||||
fn wgpu_open_and_close(keep_instance: bool) {
|
||||
let instance = Instance::default();
|
||||
let adapter =
|
||||
block_on(instance.request_adapter(&RequestAdapterOptions::default())).expect("no adapter");
|
||||
let info = adapter.get_info();
|
||||
eprintln!(
|
||||
"adapter: {} ({:?}, {})",
|
||||
info.name, info.backend, info.driver
|
||||
);
|
||||
let (device, queue) =
|
||||
block_on(adapter.request_device(&DeviceDescriptor::default())).expect("no device");
|
||||
|
||||
drop(queue);
|
||||
drop(device);
|
||||
drop(adapter);
|
||||
if keep_instance {
|
||||
std::mem::forget(instance);
|
||||
} else {
|
||||
drop(instance);
|
||||
}
|
||||
eprintln!("wgpu closed");
|
||||
}
|
||||
|
||||
/// The same shape with no wgpu in it at all, which is what makes this a
|
||||
/// loader/driver bug rather than a wgpu one.
|
||||
fn raw_vulkan_open_and_close() {
|
||||
unsafe {
|
||||
let entry = ash::Entry::load().expect("vulkan loader");
|
||||
let app = vk::ApplicationInfo::default().api_version(vk::make_api_version(0, 1, 1, 0));
|
||||
let instance = entry
|
||||
.create_instance(
|
||||
&vk::InstanceCreateInfo::default().application_info(&app),
|
||||
None,
|
||||
)
|
||||
.expect("instance");
|
||||
let phys = instance.enumerate_physical_devices().expect("devices")[0];
|
||||
let priorities = [1.0f32];
|
||||
let queues = [vk::DeviceQueueCreateInfo::default()
|
||||
.queue_family_index(0)
|
||||
.queue_priorities(&priorities)];
|
||||
let device = instance
|
||||
.create_device(
|
||||
phys,
|
||||
&vk::DeviceCreateInfo::default().queue_create_infos(&queues),
|
||||
None,
|
||||
)
|
||||
.expect("device");
|
||||
device.destroy_device(None);
|
||||
instance.destroy_instance(None);
|
||||
}
|
||||
eprintln!("raw vulkan closed");
|
||||
}
|
||||
Reference in new issue
Block a user