Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dev/adr/adr-0004-creation-from-tensor-category.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rstsr_meta:
rstsr implements the array-joining / construction-from-tensor functions
(`concat`/`concatenate`, `stack`, `hstack`, `vstack`, `diag`, `meshgrid`,
`unstack`) in `rstsr-core/src/tensor/creation_from_tensor.rs`. The prior
NumPy-parity audit (ADR-0003) covered only the `manuplication/` surface
NumPy-parity audit (ADR-0003) covered only the `manipulation/` surface
(reshape/transpose/swapaxes/moveaxis/squeeze/expand_dims/flip/broadcast/to_contig/
to_layout); `concat`/`stack`/`diag` were not covered by that audit.

Expand All @@ -24,8 +24,8 @@ rstsr does not yet implement are tracked.
1. **Parity tests for `creation_from_tensor.rs` functions live in a dedicated
`creation_from_tensor/` category** under `tests/core_func/` (mirrored under
`doc_draft/` for doc tests). The category name mirrors the source module
`src/tensor/creation_from_tensor.rs`, consistent with how `manuplication/`
mirrors `src/tensor/manuplication/` and `linalg/` mirrors `src/tensor/linalg/`.
`src/tensor/creation_from_tensor.rs`, consistent with how `manipulation/`
mirrors `src/tensor/manipulation/` and `linalg/` mirrors `src/tensor/linalg/`.
2. **The tracking scope (ADR-0003 artifact (b) `numpy_coverage.csv` and the
`sync_numpy.py` `SURFACE`) is the manipulation + creation_from_tensor
surface**, not manipulation alone. Functions rstsr does not yet implement
Expand All @@ -35,12 +35,12 @@ rstsr does not yet implement are tracked.

## Considered

- **Fold join functions into `manuplication/`** - rejected. rstsr's source groups
them in `creation_from_tensor.rs`, not `manuplication/`; the test category
- **Fold join functions into `manipulation/`** - rejected. rstsr's source groups
them in `creation_from_tensor.rs`, not `manipulation/`; the test category
mirrors the source module so the mapping is mechanical.
- **Per-function categories** (`concat/`, `stack/`, ...) - rejected; too granular.
One category per source module, holding all its parity tests, matches the
existing `manuplication/` granularity.
existing `manipulation/` granularity.

## Consequences

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ rstsr_meta:

# ADR 0004 - `creation_from_tensor` 测试类别与追踪范围扩展

rstsr 在 `rstsr-core/src/tensor/creation_from_tensor.rs` 中实现了数组拼接 / 由张量构造的函数(`concat`/`concatenate`、`stack`、`hstack`、`vstack`、`diag`、`meshgrid`、`unstack`)。此前的 NumPy parity 审计(ADR-0003)只覆盖了 `manuplication/` 这一面(reshape/transpose/swapaxes/moveaxis/squeeze/expand_dims/flip/broadcast/to_contig/to_layout);`concat`/`stack`/`diag` 不在该审计范围内。
rstsr 在 `rstsr-core/src/tensor/creation_from_tensor.rs` 中实现了数组拼接 / 由张量构造的函数(`concat`/`concatenate`、`stack`、`hstack`、`vstack`、`diag`、`meshgrid`、`unstack`)。此前的 NumPy parity 审计(ADR-0003)只覆盖了 `manipulation/` 这一面(reshape/transpose/swapaxes/moveaxis/squeeze/expand_dims/flip/broadcast/to_contig/to_layout);`concat`/`stack`/`diag` 不在该审计范围内。

本 ADR 决定这些函数的 parity 测试归在何处,以及 rstsr 尚未实现的函数如何被追踪。

## 决策

1. **`creation_from_tensor.rs` 中函数的 parity 测试归入专门的 `creation_from_tensor/` 类别**,位于 `tests/core_func/` 下(doc test 在 `doc_draft/` 下镜像一份)。类别名镜像源码模块 `src/tensor/creation_from_tensor.rs`,与 `manuplication/` 镜像 `src/tensor/manuplication/`、`linalg/` 镜像 `src/tensor/linalg/` 的做法一致。
1. **`creation_from_tensor.rs` 中函数的 parity 测试归入专门的 `creation_from_tensor/` 类别**,位于 `tests/core_func/` 下(doc test 在 `doc_draft/` 下镜像一份)。类别名镜像源码模块 `src/tensor/creation_from_tensor.rs`,与 `manipulation/` 镜像 `src/tensor/manipulation/`、`linalg/` 镜像 `src/tensor/linalg/` 的做法一致。
2. **追踪范围(ADR-0003 产物 (b) `numpy_coverage.csv` 与 `sync_numpy.py` 的 `SURFACE`)为 manipulation + creation_from_tensor 面**,而非仅 manipulation 面。rstsr 尚未实现的函数(`split`/`array_split`/`hsplit`/`vsplit`/`dsplit`、`dstack`、`column_stack`、`block`、`tile`)记录为 `todo` 行--每个 NumPy 测试类一个代表性方法,note 中给出完整的方法计数。

## 备选方案

- **将拼接函数并入 `manuplication/`** -- 否决。rstsr 源码将其归在 `creation_from_tensor.rs` 而非 `manuplication/`;测试类别镜像源码模块,使映射是机械的。
- **按函数逐个建类别**(`concat/`、`stack/`、……)-- 否决;粒度太细。每个源码模块一个类别、承载其全部 parity 测试,与现有 `manuplication/` 的粒度一致。
- **将拼接函数并入 `manipulation/`** -- 否决。rstsr 源码将其归在 `creation_from_tensor.rs` 而非 `manipulation/`;测试类别镜像源码模块,使映射是机械的。
- **按函数逐个建类别**(`concat/`、`stack/`、……)-- 否决;粒度太细。每个源码模块一个类别、承载其全部 parity 测试,与现有 `manipulation/` 的粒度一致。

## 后果

Expand Down
Loading