Define and test ULP accuracy for the square-root helpers

Đang mở
#1,040 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
compilers, testing-qa

Hướng nghiên cứu

Start at std/math/float.wave:340, where the square-root helpers are defined, and review the existing f32/f64 special-value behavior before discussing the proposed accuracy contract with @LunaStev. Use the issue’s 400-digit mpmath oracle methodology to compare exact-bit inputs at O0 and O2, including exponents, subnormals, square/halfway neighborhoods, NaN, infinities, and signed zero. Done means an agreed bound or correct-rounding guarantee is published with limitations, representative oracle-backed tests exist, and any algorithm change has O0/O2 evidence.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

discussion enhancement help wanted

Motivation

A deterministic 127-input positive binary64 sample against a 400-digit mpmath oracle found up to one ULP error in sqrt_f64 at both O0/O2; input bits=2 yields result bits 2190614870947216332 instead of nearest-reference 2190614870947216333. The helpers do not promise correct rounding, so this is an accuracy-contract proposal.

Starting point: std/math/float.wave:340.

Validation

Audited canonical Wave 540728c2eb6cc12f5c69c3fb3fdb96e07ba059a4 (0.0.1-alpha-dev), whose tree matches the local checkout. Validation: Executed 127 exact-bit inputs per O0/O2 against 400-digit oracle; not an exhaustive accuracy proof. Executed compiler probes use the matching checkout-built compiler and std on Linux amd64 (Rust 1.89.0 / LLVM 21.1.8). Source/header or mocked checks are not native execution on another OS.

Scope

Agree an error bound or correct-rounding goal for f32/f64 sqrt, then use an independent oracle to test the selected contract. Preserve existing NaN, infinities, signed zero and subnormal behavior.

Design discussion required

This issue records a proposal or an unresolved contract; it is not approval to choose new semantics. Please mention @LunaStev to discuss the design before starting implementation.

Completion criteria

  • Publish the agreed accuracy guarantee and its limitations.
  • Cover exponents, subnormals, square/halfway neighborhoods and special values.
  • Any algorithm change is justified by oracle evidence at O0/O2, not merely by matching its implementation.
Ngôn ngữ chính
Rust
Star
56
Fork
21
Merge trung bình
23 giờ 20 phút
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wavefnd/Wave

Tất cả issue của wavefnd/Wave

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.