TODO 11 KB

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