Repository navigation
Conversation
…he image The compositor and files rasterized eight committed Phosphor SVGs at start through resvg, usvg and tiny-skia: 33 third-party crates in each program, inside the server that owns the framebuffer, for icons that never change and are drawn at three fixed sizes (cursors 20, title-bar buttons 14, files' entries 32). Nothing in the tree draws at another scale: the compositor has no scale factor. So the build draws them, as it already draws the console font: src/icons.rs reads the SVG subset the icons are written in, refuses anything past it by name, and ships each as share/icons/<stem>.alpha, a coverage mask the program colours. No shipped program carries a rasterizer; userland/sprite keeps only the mask loader and the blit, and the programs lay out by the size the mask carries, so the size is declared once, beside the icon. The owner forbids a visible change, so the rasterizer reproduces resvg's pixels rather than better ones: tiny-skia's 4x4 point samples worth 16 each (63 on a pixel's last sample row), kurbo's arc-to-cubic split at usvg's 0.1 tolerance, tiny-skia's chord counts for a cubic edge and for the quads its stroker approximates an offset curve with, and source-over between shapes. Exact-area coverage was measured first and differed from resvg by up to 45/255 on 597 of 3836 pixels, all of it resvg's coarser sampling; with the emulation 35 pixels differ by one sample (16/255) and the rest are equal. A one-off differential against resvg 0.47, outside the tree, gives the numbers; the host test pins the digest of the pixels it compared. The SVGs no longer ship. Removed from the root lock: 22 packages; from the compositor and files: all 33 third-party crates each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
The host gate's clippy pass denied manual midpoints and the tag tuple's complexity; the pixels do not move (the digest test holds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
|
Evidence the body rests on: the one-off resvg differential, the screenshot diff and crop tools, the QMP driver, and the mutation patch. None of it is in the tree. The oracle's oracle
|
|
Review of #814 at 3b36e81 (round 1) Net lines ( Evidence checked against the logs: BLOCKER
NOTE
Judgements asked in the brief
SEND BACK |
…ow to re-measure it The asset test carries a tracked and an untracked committed icon again, so dropping the `.svg` arm's `ships` guard goes red: the untracked icon would ship as `minus-bold.alpha`. The digest test's failure message now says what to do (draw the icons against resvg 0.47 out of tree with the differential posted on #814 and ask the owner again on any visible change) instead of naming an oracle that exists only in a comment, and the module header no longer claims the pixels are resvg's exactly: they follow resvg's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
The crosshair, side by side (round 2)The crosshair has 29 of the 35 coverage pixels that differ, and it had no image. Below are its coverage values, drawn at 20 px in black, as it is used. resvg 0.47 is on the left and the build's mask (head cae8344, digest Image, 8x, over white: resvg | the build | difference x16: https://github.com/ToyOSOrg/ToyOS/blob/431c97a9e84a945ad34926b150b628dd0db609df/zoom-crosshair-8x.png?raw=true These links point into Every one of the 29 is more coverage on our side: 17 by 16/255, 4 by 15 (a pixel's last sample row is worth 15), 8 by 12. All 35 differing pixels over the eight icons, as signed alpha (ours − resvg): This was made with the differential posted above, rebuilt out of tree offline from the same pre-branch lock. Two additions:
The table it prints is the same at this head as at a0e5b76. --- a/src/main.rs
+++ b/src/main.rs
@@ -167,7 +167,8 @@
#[allow(dead_code)]
pub fn dump(stem: &str, size: u32, root: &std::path::Path) {
let svg = match std::env::var("SVG") { Ok(f) => std::fs::read(f).unwrap(), Err(_) => std::fs::read(root.join(format!("assets/icons/{stem}.svg"))).unwrap() };
- let r = old(&svg, size, [255, 255, 255]);
+ let color = if std::env::var("BLACK").is_ok() { [0, 0, 0] } else { [255, 255, 255] };
+ let r = old(&svg, size, color);
let m = icons::rasterize(stem, &svg);
for y in 0..size as usize {
let a: Vec<String> = (0..size as usize).map(|x| format!("{:3}", r[(y * size as usize + x) * 4 + 3])).collect();
--- a/Cargo.toml
+++ b/Cargo.toml
@@
sha2 = "0.10"
+png = "=0.18.1"// src/bin/ppm2png.rs
//! ppm2png <in.ppm> <out.png>: a binary P6 PPM, 8-bit, to an RGB PNG.
fn main() {
let a: Vec<String> = std::env::args().collect();
let b = std::fs::read(&a[1]).unwrap();
let (mut fields, mut i) = (vec![], 0);
while fields.len() < 4 {
while b[i].is_ascii_whitespace() { i += 1 }
let s = i;
while !b[i].is_ascii_whitespace() { i += 1 }
fields.push(String::from_utf8_lossy(&b[s..i]).to_string());
}
assert_eq!((fields[0].as_str(), fields[3].as_str()), ("P6", "255"));
let (w, h): (u32, u32) = (fields[1].parse().unwrap(), fields[2].parse().unwrap());
let mut enc = png::Encoder::new(std::io::BufWriter::new(std::fs::File::create(&a[2]).unwrap()), w, h);
enc.set_color(png::ColorType::Rgb);
enc.set_depth(png::BitDepth::Eight);
enc.write_header().unwrap().write_image_data(&b[i + 1..i + 1 + (w * h * 3) as usize]).unwrap();
}The guest screendumps in the comment above are of a0e5b76 (QEMU 11.1.1, TCG). The masks have the same digest at 3b36e81 and at cae8344, so the screens are the same at this head. No new guest measurement was taken this round. The next one drives QMP Mutations, round 2 (each applied with
|
|
Review of #814 at cae8344 (round 2) Net lines ( Round 1 BLOCKER
Round 1 NOTEs
Evidence at cae8344
NOTE
LAND |
|
CI at |
|
CI at |
The compositor and
filesused to rasterize the 8 committed Phosphor SVGs at startup throughresvg/usvg/tiny-skia, which put 33 third-party crates into each of them. Now the build draws the icons, insrc/icons.rs, and ships them asshare/icons/<stem>.alphacoverage masks. Each program colours its mask. No shipped program carries a rasterizer any more, and resvg is not in the host build either.The owner's rulings
toyos-build's[dependencies]either, unlikefontduefor the console font.Decisions
files' entries at 32. Nothing scales them, because the compositor has no scale factor (rg -i 'scale_factor|hidpi|buffer_scale' userland toyos toyos-abifinds nothing). A run-time rasterizer would ship about 700 lines in two programs to redraw bytes that never change. The rasterizer lives insrc/, the build crate, so the image has none.SIZESinsrc/icons.rssets each icon's size, and the.alphaheader carries it.fileslays out byicon.width()/height(). The compositor dropsCURSOR_PXand damages the largest cursor's extent.<g>, literal colours, an unread attribute or path command, and a stroke whose cap or join is not round. Each refusal has a test.root_carries_what_the_repository_declarescarries a trackedicons/x-bold.svgand an untrackedicons/minus-bold.svg, and expects onlyshare/icons/x-bold.alpha. So the.svgarm'sshipsguard is tested.the_icons_are_the_pixels_compared_with_resvgpins the masks' sha256. Its failure message says to draw the icons against resvg 0.47 out of tree with the differential posted on this pull request, and to ask the owner again on any visible change before pinning the new digest.share/icons/*.svgnow says what ships. One issue (five-apps-read-the-system-font…) citedfiles'.svgread and its line numbers, and now matches the code. Both edits are outside the brief's fence.Oracle: resvg 0.47, a one-off differential outside the tree
The program is posted in a comment on this pull request. It compiles
src/icons.rsfrom the worktree, beside the oldSprite::from_svg_coloredcopied verbatim, at every size and colour the system draws. "drawn" isSprite::draw's blend over black, white, 0x808080 andfiles' background, max per channel. This is its output at cae8344, rebuilt offline from the pre-branch lock:Guest screenshots: before (
origin/maind6298c8) and after (a0e5b76)These are QMP screendumps of the default x86-64 image under TCG, taken at a0e5b76. The masks' digest is the same at a0e5b76, 3b36e81 and cae8344, so the screens are the same at this head. The view is
filesat/system/share(folder and file icons), with the title-bar buttons and the default and resize cursors on screen.Every differing pixel on screen is in the icons row (835), the cursor (3) or the clock and meters (227): 835 + 3 + 227 = 1065. Nothing in the default image asks for the crosshair, so it is measured on the host only. Its coverage, side by side with resvg's, is posted in a comment on this pull request, together with the zoomed crops of the screens. Those were driven by a Python QMP script. A future measurement drives QMP through the harness's Rust (
tests/common/qemu.rs,tests/common/screen.rs).What leaves the image
cargo +toyos tree --offline --locked -p <p> --target x86_64-unknown-toyos -e normal,buildsystem.tomlplussupervisor: 270 → 247. The 23 that leave are arrayref, arrayvec, base64, bytemuck, data-url, fdeflate, float-cmp, imagesize, kurbo, miniz_oxide 0.8, pico-args, png, resvg, rgb, roxmltree, simplecss, siphasher, strict-num, svgtypes, tiny-skia, tiny-skia-path, usvg and xmlwriter. The other ten are still used elsewhere.Cargo.lock: 22 packages removed.bin/compositor: 2,581,344 → 917,912 bytesbin/files: 2,393,584 → 727,936 bytesGates (head cae8344;
origin/maind6298c8 had nothing new to merge)cargo test --lib icons::cargo test --lib assets::root_carries_what_the_repository_declares)cargo run -- --ci hostcargo run -- --build-onlyif ships(&path)dropped from the.svgarmroot_carries_what_the_repository_declaresred, exit 101 (minus-bold.alphashipped); tree restoredchordsthe_icons_are_the_pixels_compared_with_resvgred with the new message, exit 101; tree restoredcargo test(whole guest suite), at 3b36e81--ci host'scargo clippy --workspace --all-targets -D warnings: cleanBoth mutation patches are posted in a comment on this pull request.
Size
Cargo.lockis −211 net.src/icons.rs: 721 production lines (host build only) and 107 test lines.What I am unsure of
fileson a host still reads/system/share/iconsand panics there, as it did with the SVGs.wt/toyos-icons-evidenceand are linked only from comments. Those links break when that branch is deleted after landing.🤖 Generated with Claude Code
https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C