TODO 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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/7]
  6. - [-] Bugs [4/14]
  7. - [ ] Fix reduction-1.cc: "real_part(iter<1>(m)) = real_part(iter<1>(c))"
  8. - [ ] Invalid expressions that aren't caught by Match, either bc it makes assumptions, or bc
  9. Match isn't even involved. See checks.cc.
  10. - [X] Before merging saveload [1/1]
  11. - [X] Fix cellrank.cc: "using View::operator= on sliding view". For that, View::operator= have
  12. to be const. That breaks a lot of things
  13. - Fixed by duplicating operator= overloads on Container :-\ <2023-11-17 Fri 16:33>
  14. - [ ] const issues in View vs Container
  15. - [ ] fix conversion to const op in View, or
  16. - [ ] fix view() members in Container not to depend on conversion to const op in view (make View a member union??)
  17. - [ ] fix ViewSmall/SmallArray after the same pattern
  18. - [ ] fix RA_DEF_ASSIGNOPS return type and reuse that and RA_DEF_ASSIGNOPS_SELF in View
  19. - [X] ra::Small<real, 3, 3, 3>() benchmark in bench-dot.cc has op 10x worse
  20. than indexed
  21. - Fixed in ca20c1678bb7aa43ccf6b4fe1b93ee9c742b1630. Yay!
  22. - Appears to have regressed in 65076211eeeeecd8623877e3e3b5cc0a87af302c, although by a smaller factor. Bummer.
  23. - Looks good in v20 in g++-11, but bad in 12/13. Bummer.
  24. - Investigated & resolved in e297ee0561a647065fb5b92880fe0f994340595c ss.
  25. - [ ] Small/Big unification
  26. - [ ] Forbid initialization from higher rank
  27. - Cf 'Initialization of nested types' in the manual.
  28. - [X] size_s, rank_s in Ryn:: are broken [ra7]
  29. - [X] broken with -DNDEBUG (95ac2014bfd86cbc27e3d151f55abaceef628de4 and by <2023-05-26 Fri 15:08> in CI)
  30. - [ ] ambiguity / bad init in nested constructors [ra45]
  31. - [ ] ra::at(A, I) needs nested I, so the obvious ra::at(A, [i j]) doesn't work (although
  32. view.at([i j]) does). But I would get rid of view.at(i) if ra::at(view, i) worked the same
  33. way.
  34. - [ ] subscripting inconsistencies; for example, if `A` is rank>1 and `i` is rank 1, then `A(i)`
  35. will return a nested expression instead of preserving `A`'s rank [ra33]
  36. - [ ] beatable subscripts are not beaten if mixed with non-beatable subscripts. E.g. in
  37. A(vector, iota, vector) the iota isn't beaten. [ra33].
  38. - [ ] be namespace clean except for possibly the scalar block in ra.hh. Document exactly what is exported to ::.
  39. - [ ] bad uses of assert [ra17]
  40. - [X] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90745 (bad operator=) is cleared up. Cf [ra5].
  41. - [-] Features [1/14]
  42. - [ ] support std::format
  43. - [ ] compatibility with OpenMP, even if only for trivially parallel cases
  44. The way ply() works atm, with iterators, more or press precludes it.
  45. - [ ] support expr = braces for any expr, not just views.
  46. - [ ] make iter work with w/rank.
  47. - [ ] make iter work with foreign vectors.
  48. - [ ] Can choose iteration order in plyers. Order is already explicit, just need to expose it.
  49. - [ ] Merge Ptr and Iota. Why need more than one rank 1 IteratorConcept adaptor.
  50. - [-] Deduction guides, e.g. ra::Small a = {{1, 2}, {3, 4}} ?! maybe rank 1 first
  51. - [X] rank 1 SmallArray <2023-06-23 Fri 13:24> (not very useful)
  52. - [ ] rank >1 SmallArray
  53. - [ ] Small
  54. - [ ] Big
  55. - [ ] Support ra::len in x in o.len(x).
  56. - [ ] Shape returns Small not std::array (for static rank expr).
  57. - [-] Should be able to reshape iota (??). One idea is to generalize View (so View<Iota>, etc.)
  58. which is something that newra does. But as long as Container is parent of View, conversion of
  59. (Container const &) into (View const &) forces us to have const/nonconst overloads in View
  60. (instead of just relying on the constness of (View::p). This is just a mess when View::p isn't
  61. a pointer.
  62. - [-] Fix relationship between Container and View [3/5]
  63. - [X] fwd const/nonconst overloads to View or ViewConst from here.
  64. - [X] add const/nonconst casts of Container to View or ViewConst
  65. - [X] remove const overloads from View::operator()
  66. - [ ] remove inheritance relationship of Container on View
  67. - [ ] make View be View<pointer> and not View<value_type>
  68. - [ ] Should be able to turn ravel iterators (e.g. View::begin()) into array iterators. Ptr()
  69. doesn't work for that.
  70. - This has become more feasible after changing the iterator interface from flat to saveload,
  71. main obstacle atm seems to be the need to support copy. <2023-11-20 Mon 12:45>
  72. - One can now create a ravel iterator from an IteratorConcept <2023-11-28 Tue 16:37>
  73. - [ ] gemv(conj(a), b) should work. Beat View-like selectors down an Expr??
  74. - [ ] port some of the View ops to generic Iterator. reverse, transpose, etc. seem easy
  75. enough. Only it kind of bothers me that they need their own Expr-like types while on Views
  76. it's just a one time op. Propagating ops down Expr into leaf Views (a kind of beating) would
  77. be better.
  78. - [X] Support operator <=> <2020-09-15 Tue 13:50>
  79. - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96278 is annoying
  80. - [-] Magic subscript len
  81. - [X] For Big/View in beatable subscripts <2023-07-04 Tue 18:20>
  82. - [X] For Big/View in unbeatable subscripts <2023-07-05 Wed 12:34>
  83. - [-] For Small/ViewSmall
  84. - [X] Scalar / unbeatable <2023-08-04 Fri 14:18>
  85. - [ ] Iota. But Iota args need to integral constants for this to work.
  86. - [ ] Optimize iota(len...) + iota(len...)
  87. - [-] Performance [2/4]
  88. - [ ] bench/bench-stencil* is weird.
  89. - [ ] Bigd cases in bench-at.
  90. - [X] `*(it.flat())` is inefficient for some it, eg CellBig, because we need to create/copy flat
  91. in case it gets modified, and then it isn't. Do we need IteratorConcept::operator* ?
  92. - [X] During traversal (ply) the pattern loc = save_location(it); move flat;
  93. it.set_location(loc); would allow flat to modify the original it. Loc is often just a pointer
  94. so this would be cheap. The current design is that move flat can't modify it so it has to be a
  95. new object. CellBig is one case where that is costly, because dimv has to be copied along with
  96. the pointer to make up a View, even though dimv is constant all through traversal.
  97. - [X] Error report, debugging [3/3]
  98. - [X] Optionally throw instead of abort on bounds checks, etc. cf. test/ra-12.cc
  99. * This was fixed between v8 and v10, see examples/throw.cc.
  100. - [X] Static check on Small constructors e.g. real3 {1, 2, 3}. Cf big.hh:513 init<SS>(SS const & s).
  101. - [X] for Container constructors
  102. - [X] for Small constructors
  103. - [X] General static check on prefix matching <2019-02-06 Wed 12:06>
  104. - [-] Building, tests [4/6]
  105. - [X] Build docs with cmake
  106. - [X] Support RA_USE_BLAS with cmake (linux)
  107. - [X] Support RA_USE_BLAS with cmake (mac) <2018-12-07 Fri 16:33>
  108. - [X] TestRecorder.test_eq with mismatched shapes aborts. Should just fail the test. <2023-07-10 Mon 13:14>
  109. - We have had agree() for a while.
  110. - [ ] Make cmake tests respect dependences and able to be run independently.
  111. - [ ] Test for expected compilation errors (static_assert, etc) [ra42].
  112. - One idea (libc++?) is to fork() and check that child breaks.
  113. - [ ] Documentation [0/3]
  114. - [ ] Complete section on internals
  115. - [ ] Complete section on other languages, libraries
  116. - [ ] Describe xreferenced issues in doc ([raxx], etc.)
  117. - [ ] Other [0/4]
  118. - [ ] Reconsider len/len_s etc: Same as there are static/nonstatic versions of keep, we
  119. could remove len_s/rank_s use staticness of len/rank instead of ANY/ANY. A problem with this
  120. is that len_s lets me return ANY for some axes and finite for others and to do that with just
  121. len() would require len(integral constant) overloads possibly -- len(int k) cannot be static
  122. or not depending on k.
  123. - [ ] Review Container constructors. Why do we need (&) when we have (const &)?
  124. - [ ] Support tuple as a kind of foreign vector
  125. - [ ] Iterator type for tuple (like Vector for std::vector).
  126. - [ ] Appropriate ply. Possibly restrict it to rank 1.
  127. - [ ] Current & future C++
  128. - [ ] static_assert(__cpp_constexpr >= 202211); // c++23
  129. - [ ] static_assert(__cpp_constexpr >= 202306L); // c++26
  130. - [ ] static_assert(__cpp_static_assert >= 202306L); // c++26
  131. Some of these aren't bugs in the sense that I expect to solve them, but more like footnotes.
  132. * Numbered issues throughout the source [ra...]
  133. 1. [ ]
  134. 2. [ ]
  135. 3. [ ]
  136. 4. [ ] test/optimize.cc: Expression objects only keep pointers to data objects. This means that it
  137. is unsafe to define expression objects unless none of the data objects are
  138. temporaries. E.g. `auto e = temp + temp;` is unsafe. Either `obj a; obj b; auto e = a + b;` or
  139. `obj o = temp + temp;` is safe. Generally there's no reason to ever define expression objects
  140. explicitly.
  141. 5. [ ]
  142. 6. [ ]
  143. 7. [ ]
  144. 8. [X] test/operators.cc: Some simple expressions with scalars fail in VALUE(). The patch in ra.hh
  145. triggers the address sanitizer in test/ra-9.cc.
  146. 9. [ ] test/ra-6.cc: ra::Ptr doesn't hold copies. This enables restarting (see [ra39]), so
  147. ra::ptr(temp) must only be used as temp. Really forbidding auto ll = ra::ptr(lvalue) would also
  148. be ok.
  149. 10. [ ] test/ra-0.cc: size(SmallArray) requires ra:: to avoid collision with std::size, but not
  150. size(Big) (??).
  151. 11. [ ]
  152. 12. [ ]
  153. 13. [ ] ra/ply.hh (i/o), ra/expr.hh, ra/base.hh, test/compatibility.cc: std::string used to
  154. be registered as scalar, but that clashes with how std::ranges sees it. OTOH we don't want
  155. format(std::string_view) to print it as a foreign vector, so we have an exception for it
  156. there. As things stand, you can register it as scalar or not.
  157. 14. [ ] CellBig needs to copy its Dimv in some cases, which also complicates View::iter<>. Problem
  158. is demonstrated in ra-5.cc.
  159. 15. [ ] Conversion-to-scalar operators for dynamic-rank View(). I thought this could be
  160. https://wg21.link/cwg976 but gcc 14 doesn't fix it. There are two issues here, 1) why isn't
  161. const conversion enough and 2) ambiguity with Small's 'any' constructor (cf 'c++ converting
  162. constructor vs conversion operator').
  163. 16. [ ] Ambiguity in ravel vs nested constructors bc bc 1 converts to int2. Should be explicit
  164. (and ravel constructors also).
  165. 17. [ ] assert() is used in some cases for runtime conditions that aren't ra::'s fault. This is
  166. bad because if RA_ASSERT is defined to throw, the caller probably expects to be able to handle
  167. the error. On the other hand if RA_DO_CHECK is 0, we shouldn't continue. But ofc we do in
  168. index checks etc. So is this different?
  169. 18. [ ]
  170. 19. [ ]
  171. 20. [ ]
  172. 21. [ ]
  173. 22. [ ]
  174. 23. [ ]
  175. 24. [ ]
  176. 25. [ ]
  177. 26. [ ]
  178. 27. [ ]
  179. 28. [ ]
  180. 29. [ ]
  181. 30. [ ]
  182. 31. [ ]
  183. 32. [ ]
  184. 33. [ ] test/frame-old.cc, test/fromb.cc: When mixing beaten & unbeaten subscripts and the
  185. unbeaten subscripts go first, the result is a nested expression. This has to be fixed in the
  186. view operator()s.
  187. 34. [ ]
  188. 35. [ ]
  189. 36. [ ]
  190. 37. [ ]
  191. 38. [ ]
  192. 39. [ ] test/ra-7.cc: There's no reason to restart, since the Iterator methods are all static. So
  193. start(ra::Scalar) just fwds. But that means that Scalar::c maintain constness, so a const
  194. overload is required for ScalarFlat::operator*.
  195. 40. [ ]
  196. 41. [ ]
  197. 42. [ ] Ways to test that compile time assertions or constraints are triggered appropriately,
  198. esp. for things like ct array lookup. Some are doable with concepts, see e.g. ra-14.cc or
  199. big-0.cc.
  200. 43. [ ]
  201. 44. [ ]
  202. 45. [ ]
  203. 46. [ ]
  204. 47. [ ] ra/big.hh, test/const.cc, ra/view-ops.hh ...: Review constness in ra/view-ops.hh after the
  205. Big/View const fixes after 913d6b531801609cb61bb7f631ddf50de701a802.