샘플
ryu 1.0.23
검증된 샘플 — cargo ryu 1.0.23. rust 1 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: Buffer::new and format convert f64 floating point values to decimal…
sha256:7d84891307add5fc73e60f6e3ac3a493a6f862a0f4142fec0134056d18c8e5b3
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux · alpine · musl x64 cargo
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-09-19 |
케이스
HOW- 목표
- verify pkg:cargo/ryu@1.0.23
- 패키지
- 생성일
- 2026-09-18T13:23:06Z
컨트랙트
- Buffer::new and format convert f64 floating point values to decimal strings
- Buffer::format converts f32 floating point values to decimal strings
- Buffer::format converts special non-finite floats to NaN, inf, and -inf strings
- Buffer::format_finite formats finite f64 and f32 floating point values
- Buffer implements Default and Copy traits for reusable formatting buffers
- raw format64 and format32 write decimal bytes directly into raw buffers
파일
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
소스
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "ryu"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
[[package]]
name = "sample-ryu"
version = "1.0.0"
dependencies = [
"ryu",
]
[package]
name = "sample-ryu"
version = "1.0.0"
edition = "2021"
publish = false
[dependencies]
ryu = "=1.0.23"
[[bin]]
name = "contract"
path = "test/contract.rs"
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:cargo/ryu@1.0.23
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/ryu@1.0.23
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:7c4dd000bba901d0005ba37c3442744c0938642716b256df0735c761e0bad12e","contract":["Buffer::new and format convert f64 floating point values to decimal strings","Buffer::format converts f32 floating point values to decimal strings","Buffer::format converts special non-finite floats to NaN, inf, and -inf strings","Buffer::format_finite formats finite f64 and f32 floating point values","Buffer implements Default and Copy traits for reusable formatting buffers","raw format64 and format32 write decimal bytes directly into raw buffers"],"goal":"verify pkg:cargo/ryu@1.0.23","kind":"HOW","packages":["pkg:cargo/ryu@1.0.23"],"schemaVersion":1},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","distro":"alpine","ecosystem":"cargo","libc":"musl","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/ryu@1.0.23"],"schemaVersion":1,"subject":"pkg:cargo/ryu@1.0.23","verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify pkg:cargo/ryu@1.0.23",
"kind": "HOW",
"packages": [
"pkg:cargo/ryu@1.0.23"
]
}
//! Clean-room verification sample for ryu.
pub use ryu::*;
use ryu::raw;
use ryu::Buffer;
fn main() {
// 1. Buffer::new and format convert f64 floating point values to decimal strings
let mut buffer = Buffer::new();
let s1 = buffer.format(1.2345f64);
assert_eq!(s1, "1.2345");
let s2 = buffer.format(0.0f64);
assert_eq!(s2, "0.0");
let s3 = buffer.format(-0.0f64);
assert_eq!(s3, "-0.0");
let s4 = buffer.format(1e40f64);
assert_eq!(s4, "1e40");
let s5 = buffer.format(1.23e-40f64);
assert_eq!(s5, "1.23e-40");
// 2. Buffer::format converts f32 floating point values to decimal strings
let mut buffer32 = Buffer::new();
let s32_1 = buffer32.format(1.2345f32);
assert_eq!(s32_1, "1.2345");
let s32_2 = buffer32.format(0.0f32);
assert_eq!(s32_2, "0.0");
let s32_3 = buffer32.format(-123.456f32);
assert_eq!(s32_3, "-123.456");
// 3. Buffer::format converts special non-finite floats to NaN, inf, and -inf strings
let mut special_buf = Buffer::new();
assert_eq!(special_buf.format(f64::NAN), "NaN");
assert_eq!(special_buf.format(f64::INFINITY), "inf");
assert_eq!(special_buf.format(f64::NEG_INFINITY), "-inf");
assert_eq!(special_buf.format(f32::NAN), "NaN");
assert_eq!(special_buf.format(f32::INFINITY), "inf");
assert_eq!(special_buf.format(f32::NEG_INFINITY), "-inf");
// 4. Buffer::format_finite formats finite f64 and f32 floating point values
let mut finite_buf = Buffer::new();
let f64_str = finite_buf.format_finite(2.718281828459045f64);
assert_eq!(f64_str, "2.718281828459045");
let f32_str = finite_buf.format_finite(3.1415927f32);
assert_eq!(f32_str, "3.1415927");
// 5. Buffer implements Default and Copy traits for reusable formatting buffers
let mut def_buf = Buffer::default();
assert_eq!(def_buf.format(42.0f64), "42.0");
let mut copy_buf = def_buf;
assert_eq!(copy_buf.format(100.5f64), "100.5");
assert_eq!(def_buf.format(200.5f64), "200.5");
// 6. raw format64 and format32 write decimal bytes directly into raw buffers
unsafe {
let mut raw_bytes = [0u8; 32];
let len64 = raw::format64(12345.6789f64, raw_bytes.as_mut_ptr());
let str64 = std::str::from_utf8(&raw_bytes[..len64]).unwrap();
assert_eq!(str64, "12345.6789");
let len32 = raw::format32(9876.543f32, raw_bytes.as_mut_ptr());
let str32 = std::str::from_utf8(&raw_bytes[..len32]).unwrap();
assert_eq!(str32, "9876.543");
}
println!("All ryu contract assertions passed successfully.");
}
오리진 시더
익명