TODO 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. RA -*- mode: org; -*-
  2. help: [C-uc .] insert timestamp [C-cc] flip checkbox [C-uucc] partial flip [M-RET] continue list
  3. checkbox [C-ct] flip TODO
  4. #+STARTUP: logdone
  5. * TODO [1/6]
  6. - [-] Bugs [1/7]
  7. - [ ] ra::Small<real, 3, 3, 3>() benchmark in bench-dot.cc has op 10x worse
  8. than indexed
  9. - Tried is_constant_eval in c++20 but didn't work out as I hoped.
  10. - [X] size_s, rank_s in Ryn:: are broken [ra07]
  11. - [ ] ambiguity / bad init in nested constructors [ra45]
  12. - [ ] subscripting inconsistencies; for example, if `A` is rank>1 and `i` is
  13. rank 1, then `A(i)` will return a nested expression instead of preserving
  14. `A`'s rank.
  15. - [ ] beatable subscripts are not beaten if mixed with non-beatable
  16. subscripts. E.g. in A(vector, iota, vector) the iota isn't beaten.
  17. - [ ] be namespace clean except for possibly real.hh, complex.hh.
  18. - [ ] make iter work with w/rank.
  19. - [-] Features [1/5]
  20. - [ ] Iota is both vector-like object and iterator. Split into two types?
  21. - [ ] View::p is not const because it's used as sliding window (cell_iterator). Split into two types?
  22. - [ ] Should be able to reshape iota (??) or show examples with TensorIndex,
  23. maybe. One idea is to generalize View (so View<Iota>, etc.) which is
  24. something that newra does. But as long as Container is parent of View,
  25. conversion of (Container const &) into (View const &) forces us to have
  26. const/nonconst overloads in View (instead of just relying on the constness
  27. of (View::p). This is just a mess when View::p isn't a pointer.
  28. - [ ] Fix relationship between Container and View [0/5]
  29. - [ ] forward const/nonconst overloads to View or ViewConst from here.
  30. - [ ] remove inheritance relationship of Container on View
  31. - [ ] add const/nonconst casts of Container to View or ViewConst
  32. - [ ] remove const overloads from View::operator()
  33. - [ ] make View be View<pointer> and not View<value_type>
  34. - [ ] Should be able to turn ravel iterators (e.g. View::begin()) into array
  35. iterators. Ptr() doesn't work for that. Or to obtain STLIterator from any
  36. array iterator. That may come of merging STLIterator with
  37. ply_index/ply_ravel.
  38. - [ ] gemv(conj(a), b) should work. Beat View-like selectors down an Expr??
  39. - [ ] port some of the View ops to generic ArrayIterator. reverse,
  40. transpose, etc. seem easy enough. Only it kind of bothers me that they
  41. need their own Expr-like types while on Views it's just a one time
  42. op. Propagating ops down Expr into leaf Views (a kind of beating) would be
  43. better.
  44. - [X] Support operator <=> <2020-09-15 Tue 13:50>
  45. - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96278 is annoying
  46. - [X] Error report, debugging [3/3]
  47. - [X] Optionally throw instead of abort on bounds checks, etc. cf. test/check-runtime.cc
  48. * This was fixed between v8 and v10, see examples/throw.cc.
  49. - [X] Static check on Small constructors e.g. real3 {1, 2, 3}. Cf big.hh:513 init<SS>(SS const & s).
  50. - [X] for Container constructors
  51. - [X] for Small constructors
  52. - [X] General static check on prefix matching <2019-02-06 Wed 12:06>
  53. - [-] Building, tests [3/5]
  54. - [X] Build docs with cmake
  55. - [X] Support RA_USE_BLAS with cmake (linux)
  56. - [X] Support RA_USE_BLAS with cmake (mac) <2018-12-07 Fri 16:33>
  57. - [ ] Make cmake tests respect dependences and able to be run independently.
  58. - [ ] Test for expected compilation errors (static_assert, etc) [ra42].
  59. - [ ] Documentation [0/3]
  60. - [ ] Complete section on internals
  61. - [ ] Complete section on other languages, libraries
  62. - [ ] Describe xreferenced issues in doc ([raxx], etc.)
  63. - [ ] Other [0/1]
  64. - [ ] Support tuple as a kind of foreign vector
  65. - [ ] Iterator type for tuple (like Vector for std::vector).
  66. - [ ] Appropriate ply. Possibly restrict it to rank 1.
  67. Will stop reusing issue numbers so I can keep the record. Some of these aren't bugs in the sense that I expect to solve them, but more like footnotes.
  68. * Numbered issues throughout the source [ra...]
  69. 1. [ ]
  70. 2. [ ]
  71. 3. [ ]
  72. 4. [ ] test/optimize.cc
  73. Expression objects only keep pointers to data objects. This means that it is unsafe to define expression objects unless none of the data objects are temporaries. E.g. `auto e = temp + temp;` is unsafe. Either `obj a; obj b; auto e = a + b;` or `obj o = temp + temp;` is safe. Generally there's no reason to ever define expression objects explicitly.
  74. 5. [ ]
  75. 6. [ ]
  76. 7. [ ]
  77. 8. [ ]
  78. 9. [ ] test/ra-6.cc
  79. Using the same lvalue ra::vector multiple times in an expression is broken, since start(ra::Vector) doesn't restart, so they clash with each other in ply. See also [ra39].
  80. The reason start(ra::Vector) doesn't restart is that ra::Vector may contain a copy of v instead of a reference, same as ra::Scalar. But this is problematic since plying modifies the RaIterator. So I should split ra::Vector into the Array-like owning object and the RaIterator object which is exclusively a temp and can be made to hold a ref.
  81. 10. [ ] test/ra-0.cc
  82. size(SmallArray) requires ra:: to avoid collision with std::size, but not size(Big) (??).
  83. 11. [ ]
  84. 12. [ ]
  85. 13. [ ]
  86. 14. [ ]
  87. 15. [ ]
  88. 16. [ ]
  89. 17. [ ]
  90. 18. [ ] ra/big.hh, test/big-1.cc
  91. Conversions from View<non-const P> to View<P> of the same rank. Cf [ra29].
  92. 19. [ ] ra/big.hh, ra/small.hh
  93. FIXME
  94. It's inconsistent that View argument is a pointer type while SmallView's is not.
  95. 20. [ ]
  96. 21. [ ]
  97. 22. [ ]
  98. 23. [ ]
  99. 24. [ ]
  100. 25. [ ]
  101. 26. [ ]
  102. 27. [ ] ra/big.hh, ra/bootstrap.hh
  103. FIXME
  104. P is constrained to std::random_access_iterator but eventually should allow at least Iota.
  105. 28. [ ] test/big-1.cc
  106. FIXME
  107. A constructor function make_view should be available to deduce P of the result View<P>.
  108. 29. [ ] ra/big.hh, test/big-1.cc
  109. Conversions from View<non-const P> to View<P> with different rank class (fixed to var). Cf [ra18].
  110. 30. [ ]
  111. 31. [ ]
  112. 32. [ ]
  113. 33. [ ]
  114. 34. [ ]
  115. 35. [ ]
  116. 36. [ ]
  117. 37. [ ]
  118. 38. [ ]
  119. 39. [ ] test/ra-7.cc
  120. There's no reason to restart, since the RaIterator methods are all static. So start(ra::Scalar) just forwards. But that means that Scalar::c maintain constness, so a const overload is required for ScalarFlat::operator*.
  121. 40. [ ]
  122. 41. [ ]
  123. 42. [ ]
  124. 43. [ ] bench/bench-dot.cc
  125. The performace of f_small_op depends on the optimization in plyf() through ocd<>(). Doing this required having static and non-static versions of RaIterator::keep_stride in Match/Expr. Possibly the same could be done to reduce rank/rank_s, size/size_s to just rank/size, and check for static-ness instead of RANK_ANY/DIM_ANY.
  126. 44. [ ]
  127. 45. [ ]
  128. 46. [ ]
  129. 47. [ ] ra/big.hh, test/const.cc, ra/view-ops.hh ...
  130. FIXME
  131. In the viewp branch View doesn't have any const-dependent members anymore. Constness depends instead on the constness of View::p. However this means that the const transfer has to be implemented in Container now, and that Container cannot be public-derived from View. This requires a fair amount of patching/refactoring still TBD.
  132. In the view2 branch however View retains its const-dependent members. The inconsistency that data() isn't const dependent remains, but then it's impossible to differentiate between const-contents and const-view for View<> const, fixing that breaks any of the functions taking View const & for the view only, which should be transparent to the contents (transpose, reverse, etc).