Record/replay: experiment with recording nondeterministic NaNs

未关闭
#15,461 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust, wasm

调研方向

Read the ongoing record/replay work in #15412 and investigate where FP NaN canonicalization currently occurs. Explore recording and replaying floating point values at those points, measuring both runtime overhead and trace size against the existing approach. Done means identifying an approach that preserves non-canonical NaN bit patterns during replay while keeping those costs manageable.

由索引模型根据 Issue 内容生成。

描述

In the current R/R work (#15412 and ongoing), we handle FP NaN values by enabling NaN canonicalization, so replay on any host (possibly a different ISA than the recording host) gets the same, bit-identical, values.

This works for all use-cases that require determinism, but it does potentially change the recorded execution with respect to one without canonicalization, if the recording host normally produces non-canonical NaNs. In some debugging scenarios, the user might need to diagnose (and replay) an issue that specifically has to do with non-canonical bit patterns.

We should support an alternative mode where we instead record every FP value that passes through the program (or at least, at points where we currently do canonicalization), and replay those values from the trace.

The main concerns with this approach are performance and trace size: we generally get low recording overhead by recording only what happens "at the boundary" and letting execution within the sandbox run unimpeded. This instead inserts some logic in the hot path of every bit of FP code (including e.g. every iteration of a hot matmul loop or whatever). That could also potentially bloat the trace significantly, if the program does heavy FP computation but relatively little IO (e.g., many physics, graphics, or other numeric programs). The challenge is thus to find a way to optimize this as much as possible.

主要语言
Rust
星标
18.9k
派生
2k
平均合并
1 天 6 小时
30 天内合并 PR
238

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bytecodealliance/wasmtime 的其他 Issue

查看 bytecodealliance/wasmtime 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。