Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Indexing order for 3D `integer_array_t` doesn't make sense

オープン
#1,011 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
領域
backend

調査の方向性

Start with integer_array_pkg-body.vhd at the linked 3D and 2D get implementations, then inspect set and the reshape behavior mentioned in the issue. Determine the indexing order that preserves 2D consistency and gives sensible results after reshaping; done means the 3D indexing behavior is defined, tested, and documented. The issue has had no comments for 895 days.

索引モデルが issue の本文から書いたものです。

説明

The indexing order for the 3D version of integer_array_t doesn't make any sense. You can see the code for get here:

https://github.com/VUnit/vunit/blob/3032da050f11bdf038053f67fc664c39ee19f9f6/vunit/vhdl/data_types/src/integer_array_pkg-body.vhd#L219

y is multiplied by both width and depth, x is only multiplied by depth, and z isn't multiplied by anything.

The indexing of get is consistent with set, which is why it hasn't been caught until now. The problem comes when you try to index after a reshape, which is how I discovered the problem. If you reshape a 3D array into a 2D array, you can't get results that make sense.

The "obvious" solution would be

< return get(arr.data, (y*arr.width + x)*arr.depth + z);
---
> return get(arr.data, (x*arr.width + y)*arr.depth + z);

But this solution would end up inconsistent with the 2D version of get:

https://github.com/VUnit/vunit/blob/3032da050f11bdf038053f67fc664c39ee19f9f6/vunit/vhdl/data_types/src/integer_array_pkg-body.vhd#L208

I'm not really sure what to do here. It seems like the change that would be least likely to break existing code would be

return get(arr.data, (z*arr.depth + y)*arr.width + x);

since that is consistent with the existing indexing order for 2D arrays.

Has anyone ever decided whether integer_array_t stores data in row-major or column-major order? The indexing for 2D arrays suggests column-major, but that goes against C and Python. It seems like that is something that should be documented and guaranteed.

主要言語
VHDL
スター
850
フォーク
305
平均マージ
2日 10時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

VUnit/vunit のほかの issue

VUnit/vunit の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。