<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Tuning and Debugging with no replies sorted by most likes.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1241974" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1071528" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/323055" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1087153" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/272658" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3353494" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2561444" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2305316" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/977819" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/516227" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3222475" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2940172" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2931747" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2759635" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2733766" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2599137" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2309593" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2171196" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3635801" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3562641" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1241974">
    <title>Bug with Block &amp;amp; Lookup: Scope Variable Leak.</title>
    <link>https://community.wolfram.com/groups/-/m/t/1241974</link>
    <description>After debugging a large chunk of code, I could identify this [MWE](https://en.wikipedia.org/wiki/Minimal_Working_Example).&#xD;
&#xD;
    ClearAll@test&#xD;
    test[var_String]:= Block[{association},&#xD;
        association = &amp;lt;|&amp;#034;x&amp;#034;-&amp;gt; &amp;lt;|&amp;#034;key01&amp;#034;-&amp;gt; &amp;#034;ok&amp;#034;|&amp;gt;|&amp;gt;[var];&#xD;
        Lookup[association,&amp;#034;key01&amp;#034;,{}]&#xD;
    ]&#xD;
&#xD;
If I evaluate:&#xD;
&#xD;
    test[&amp;#034;x&amp;#034;]&#xD;
    test[&amp;#034;y&amp;#034;]&#xD;
    test[&amp;#034;x&amp;#034;]&#xD;
&#xD;
I get an error evaluating the last `test[&amp;#034;x&amp;#034;]`. What is very strange, I expected to find an error just in the evaluation of `test[&amp;#034;y&amp;#034;]`.&#xD;
&#xD;
The same error does not occur if we change from Block to Module. In the Block case, we have some sort of unexpected scope leak.&#xD;
Looks like a bug in `Lookup`.&#xD;
&#xD;
Tested in Mathematica version 11.3  &#xD;
[Cross post](https://mathematica.stackexchange.com/questions/161616) in Stack Exchange</description>
    <dc:creator>Rodrigo Murta</dc:creator>
    <dc:date>2017-12-08T21:32:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1071528">
    <title>Performance problem: NeighborhoodGraph is unreasonably slow</title>
    <link>https://community.wolfram.com/groups/-/m/t/1071528</link>
    <description>For those who use `NeighborhoodGraph`, be aware: when called with default options, this functions performs much worse than it should.&#xD;
&#xD;
The reason is that it computes a graph layout even if the result is never displayed.&#xD;
&#xD;
Let&amp;#039;s see how slow it is on a big graph:&#xD;
&#xD;
    g = RandomGraph[BarabasiAlbertGraphDistribution[50000, 3]];&#xD;
&#xD;
    NeighborhoodGraph[g, 1]; // AbsoluteTiming&#xD;
    (* {61.2058, Null} *)&#xD;
&#xD;
And now do the same computation using `AdjacencyList`:&#xD;
&#xD;
    Subgraph[g, Append[AdjacencyList[g, 1], 1]]; // AbsoluteTiming&#xD;
    (* {0.019827, Null} *)&#xD;
&#xD;
**It&amp;#039;s 3000 times faster, even though it does the same thing!**  Why?  Because `NeighborhoodGraph` recomputes the graph layout. Turn this off, and it becomes fast:&#xD;
&#xD;
    NeighborhoodGraph[g, 1, GraphLayout -&amp;gt; None]; // AbsoluteTiming&#xD;
    (* {0.018846, Null} *)&#xD;
&#xD;
Why does `NeighborhoodGraph` compute the graph layout?  I do not know, but it makes no sense at all, given that the result may never be displayed.  Mathematica can generally work just fine with graphs that are simply too large to visualize in a reasonable amount of time. But not `NeighborhoodGraph`.&#xD;
&#xD;
What is frustrating is that this problem was reported 4 years ago, and mentioned multiple times on this very site. Yet it is still unfixed in version 11.1.  Unfortunately, this is an all too common experience with `Graph`-related functions.</description>
    <dc:creator>Szabolcs Horvát</dc:creator>
    <dc:date>2017-04-24T18:58:10Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/323055">
    <title>Units are cute but with come with high overhead</title>
    <link>https://community.wolfram.com/groups/-/m/t/323055</link>
    <description>Scenario - a series of distances between GPS points.  (Some overhead in getting there too).&#xD;
Fold the list for accumulated distances along a path.&#xD;
How costly are units?  About 3 orders of magnitude after realizing that 0.0 is converted on every function call.&#xD;
&#xD;
    (* series of distances between points, will accumulate the path length *)&#xD;
    &#xD;
    points = 30000;&#xD;
    distances = &#xD;
      Table[Quantity[RandomReal[{10., 100.}], &amp;#034;Meters&amp;#034;], {points}];&#xD;
    Timing[&#xD;
     path = FoldList[Plus, 0.0, distances];&#xD;
     ]&#xD;
    &#xD;
    (* Lets not forget to put the same units on that zero - could be the  source of a gotcha *)&#xD;
    &#xD;
    distances = &#xD;
      Table[Quantity[RandomReal[{10., 100.}], &amp;#034;Meters&amp;#034;], {points}];&#xD;
    Timing[&#xD;
     path = FoldList[Plus, Quantity[ 0.0, &amp;#034;Meters&amp;#034;], distances];&#xD;
     ]&#xD;
    &#xD;
    (* what if I stick to unit-less data? *)&#xD;
    &#xD;
    rawdistances = Table[RandomReal[{10., 100.}], {points}];&#xD;
    Timing[&#xD;
     path = FoldList[Plus, 0.0, rawdistances];&#xD;
     ]&#xD;
&#xD;
    {28.984986, Null}&#xD;
    &#xD;
    {7.597249, Null}&#xD;
    &#xD;
    {0.015600, Null}&#xD;
&#xD;
&#xD;
What about Accumulate?  (Only 1000 points - far worse)&#xD;
&#xD;
    points = 1000;&#xD;
    distances = &#xD;
      Table[Quantity[RandomReal[{10., 100.}], &amp;#034;Meters&amp;#034;], {points}];&#xD;
    Timing[&#xD;
     path = Accumulate[distances];&#xD;
     ]&#xD;
&#xD;
&#xD;
    {23.868153, Null}</description>
    <dc:creator>Douglas Kubler</dc:creator>
    <dc:date>2014-08-18T15:01:07Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1087153">
    <title>qmDirac: Quantum Beta Testers wanted</title>
    <link>https://community.wolfram.com/groups/-/m/t/1087153</link>
    <description>Dear community, I am the main author of an old Quantum Mechanics add-on for Mathematica. We are not updating it anymore because we are creating a totally new Quantum Mechanics package, it will be very likely called qmDirac. The old Quantum Mathematica was very difficult to update, because through the years I wrote a messy source code. Our new qmDirac package is in a very early stage of development, however it would be great for me if you or your students try to use it, and let me know your thoughts and suggestions, this is the link: [http://qmdirac.weebly.com/beta-testers.html][1]&#xD;
&#xD;
Please take into account that the old Quantum Mathematica and the new qmDirac are not compatible, you cannot copy-paste from one to the other, neither use one file with symbols from one with the other, it will not work. &#xD;
As I said, the new qmDirac is in a very early stage, I believe you might find it is slow, or perhaps even wrong, in some calculations; please let us know if that is the case, as well as suggestions for new commands of functionality that you would like to use. And, well, we do not have any real documentation yet, just very few examples, without any explanation, in this link: [http://qmdirac.weebly.com/examples.html][2] &#xD;
Anyway I hope our efforts can be of some help to your research and teaching work. Hope to hear from you or from your students soon in this forum.&#xD;
&#xD;
Jose&#xD;
&#xD;
Mexico&#xD;
&#xD;
&#xD;
  [1]: http://qmdirac.weebly.com/beta-testers.html&#xD;
  [2]: http://qmdirac.weebly.com/examples.html</description>
    <dc:creator>Jose Gomez</dc:creator>
    <dc:date>2017-05-08T20:14:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/272658">
    <title>Notes on built-in debugger in Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/272658</link>
    <description>Notes I was given when the debugger was new. &amp;lt;BR&amp;gt;&#xD;
No promises that the debugger hasn&amp;#039;t changed in the years since. &#xD;
&#xD;
============== &amp;lt;BR&amp;gt;&#xD;
Some notes on the debugger buttons are linked to from the &amp;#034;Details&amp;#034; section of &amp;lt;BR&amp;gt; &#xD;
[http://reference.wolfram.com/mathematica/ref/menuitem/DebuggerControls.html][1]&#xD;
&#xD;
The code the instructions refer to is &#xD;
&#xD;
    Module[{a},&#xD;
       Do[&#xD;
           a = {i, Sin[i]},&#xD;
        {i, 100}]]&#xD;
&#xD;
* the debugger is enabled by choosing Evaluation menu &amp;gt; Debugger&#xD;
     from the menu bar.&#xD;
* a palette will open &#xD;
* select the code you are interested in examining (e.g., triple click on a variable)&#xD;
* press the &amp;#034;Break at Selection&amp;#034; button in the debugger palette&#xD;
* evaluate your example&#xD;
* note that the evaluation pauses and the &amp;#034;a = ...&amp;#034; block is highlighted.&#xD;
* click &amp;#034;Show Stack&amp;#034; in the debugger palette&#xD;
* this brings up a window showing you what is evaluating&#xD;
* in the stack window click the opener triangle labeled &amp;#034;Local Variables&amp;#034;&#xD;
* here you can see that the variable does not yet have a value&#xD;
* press the &amp;#034;Step&amp;#034; button in the debugger palette&#xD;
* note that &amp;#034;a&amp;#034; now has the value {1, Sin[1]}&#xD;
* press &amp;#034;Step&amp;#034; again&#xD;
* note that &amp;#034;a&amp;#034; now has the value {2, Sin[2]}&#xD;
* press &amp;#034;Continue&amp;#034; on the debugger palette a few times&#xD;
* it will stop each time it hits the &amp;#034;a = ...&amp;#034; breakpoint&#xD;
* click the &amp;#034;Show Breakpoints&amp;#034; button on the debugger palette&#xD;
* delete the breakpoint&#xD;
* press &amp;#034;Continue&amp;#034; on the debugger palette&#xD;
* the evaluation will complete &#xD;
&#xD;
 The most common gotcha to the Mathematica debugger is that it works &#xD;
only for code which has been evaluated *after* the debugger has been&#xD;
 enabled.  You can&amp;#039;t evaluate a function, turn on the debugger, then&#xD;
 debug code which uses that function.  You must first turn on the&#xD;
 debugger, then evaluate all function definitions you wish to debug,&#xD;
 then you can set working breakpoints and step through code.&#xD;
&#xD;
============== &#xD;
&#xD;
  [1]: http://reference.wolfram.com/mathematica/ref/menuitem/DebuggerControls.html</description>
    <dc:creator>Bruce Miller</dc:creator>
    <dc:date>2014-06-08T23:21:55Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3353494">
    <title>Is there a way to improve wolframscript startup time?</title>
    <link>https://community.wolfram.com/groups/-/m/t/3353494</link>
    <description>I just began experimenting with running wolframsrcipt on Macos, so far the startup time is very disappointing. I wrote the following script:&#xD;
    &#xD;
    #!/usr/local/bin/wolframscript &#xD;
    Print[&amp;#034;hello&amp;#034;]&#xD;
&#xD;
Running this script takes roughly five seconds, consistently.  For instance, here I time the script from bash:&#xD;
&#xD;
    ~/bin # time ./hello.wls&#xD;
    hello&#xD;
    real    0m4.809s&#xD;
    user    0m0.173s&#xD;
    sys     0m0.049s&#xD;
&#xD;
Here is the version info for my installation of wolframscript:&#xD;
&#xD;
    ~/bin # wolframscript -info&#xD;
    Wolfram 14.1.0 Kernel for Mac OS X x86 (64-bit)&#xD;
    Copyright 1988-2024 Wolfram Research, Inc.&#xD;
&#xD;
Is this typical performance? A five second startup for a trivial script is a deal breaker for me. If anyone can suggest ways to make this faster, or to diagnose the reasons for the slow startup I&amp;#039;d love to explore them. On the other hand, if this is the expected level of performance I&amp;#039;ll explore other avenues for my scripting needs. &#xD;
&#xD;
Thank you.&#xD;
&#xD;
David Cabana</description>
    <dc:creator>David Cabana</dc:creator>
    <dc:date>2025-01-08T19:05:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2561444">
    <title>ListContourPlot3D in version 13.1 changed, but with issues?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2561444</link>
    <description>After the installation of 13.1 my standard tests of my paclet revealed that all function using `ListControurPlot3D` changed. &#xD;
&#xD;
I was always aware that in `ListContourPlot3D` the data is somehow transposed if you provide it as an array as can be seen in the following code. And for data with isotropic dimensions (21x21x21) it seems that both versions behave the same.&#xD;
&#xD;
    dat = Table[&#xD;
       x^2 + y^2 - z^2, {x, -2, 2, 0.2}, {y, -2, 2, 0.2}, {z, -2, 2, 0.2}];&#xD;
    dat2 = Flatten[&#xD;
       Table[{x, y, z, x^2 + y^2 - z^2}, {x, -2, 2, 0.2}, {y, -2, 2, &#xD;
         0.2}, {z, -2, 2, 0.2}], 2];&#xD;
    Dimensions[dat]&#xD;
    opts = Sequence[{Mesh -&amp;gt; None, AxesLabel -&amp;gt; {&amp;#034;x&amp;#034;, &amp;#034;y&amp;#034;, &amp;#034;z&amp;#034;}, &#xD;
        ImageSize -&amp;gt; 200}];&#xD;
    Row[{&#xD;
      ContourPlot3D[&#xD;
       x^2 + y^2 - z^2 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, &#xD;
       Mesh -&amp;gt; None, AxesLabel -&amp;gt; {&amp;#034;x&amp;#034;, &amp;#034;y&amp;#034;, &amp;#034;z&amp;#034;}, ImageSize -&amp;gt; 200],&#xD;
      ListContourPlot3D[dat, Contours -&amp;gt; {0}, opts],&#xD;
      ListContourPlot3D[Transpose[dat, {3, 2, 1}], Contours -&amp;gt; {0}, opts],&#xD;
      ListContourPlot3D[dat2, Contours -&amp;gt; {0}, opts]&#xD;
      }]&#xD;
&#xD;
13.0.1&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
13.1&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
But now consider the same data but with anisotropic dimensions (11x41x81). It has always been that the dimension index would be {z, y, x}. But with 13.1 it changed to {x, y, z}. Which i get since now this function is actually agreeing with the other 3D plotting functions. However, although the axes indexes / labels are changed the data orientation is not but should have been. This is giving wrong plots. &#xD;
&#xD;
    dat = Table[&#xD;
       x^2 + y^2 - z^2, {x, -2, 0, 0.2}, {y, -2, 2, 0.1}, {z, -2, 2, &#xD;
        0.05}];&#xD;
    dat2 = Flatten[&#xD;
       Table[{x, y, z, x^2 + y^2 - z^2}, {x, -2, 0, 0.2}, {y, -2, 2, &#xD;
         0.1}, {z, -2, 2, 0.05}], 2];&#xD;
    Dimensions[dat]&#xD;
    opts = Sequence[{Mesh -&amp;gt; None, AxesLabel -&amp;gt; {&amp;#034;x&amp;#034;, &amp;#034;y&amp;#034;, &amp;#034;z&amp;#034;}, &#xD;
        ImageSize -&amp;gt; 200}];&#xD;
    Row[{&#xD;
      ContourPlot3D[&#xD;
       x^2 + y^2 - z^2 == 0, {x, -2, 0}, {y, -2, 2}, {z, -2, 2}, &#xD;
       Mesh -&amp;gt; None, AxesLabel -&amp;gt; {&amp;#034;x&amp;#034;, &amp;#034;y&amp;#034;, &amp;#034;z&amp;#034;}, ImageSize -&amp;gt; 200],&#xD;
      ListContourPlot3D[dat, Contours -&amp;gt; {0}, opts],&#xD;
      ListContourPlot3D[Transpose[dat, {3, 2, 1}], Contours -&amp;gt; {0}, opts],&#xD;
      ListContourPlot3D[dat2, Contours -&amp;gt; {0}, opts]&#xD;
      }]&#xD;
&#xD;
13.0.1&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
13.1&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
In my opinion both are actually wrong but in 13.0.1 the data orientation was wrong but consistent with the axes. In 13.1 the axes are correct but the data is not consistent with the axes. &#xD;
My workaround used to be to just Transpose the data, now my workaround is to convert the arrays to coordinate lists {x, y, z, f}. &#xD;
&#xD;
&#xD;
Is this a know issue / bug, or is it by design and am i missing something. &#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1301iso.png&amp;amp;userId=1332602&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=131iso.png&amp;amp;userId=1332602&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1301aniso.png&amp;amp;userId=1332602&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=131aniso.png&amp;amp;userId=1332602</description>
    <dc:creator>Martijn Froeling</dc:creator>
    <dc:date>2022-07-01T09:52:44Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2305316">
    <title>Shared-memory parallelism with large data</title>
    <link>https://community.wolfram.com/groups/-/m/t/2305316</link>
    <description>I was hoping to seek the advise of others that may have tackled (or been tackled by) the problem of having a large dataset to query in Mathematica.&#xD;
&#xD;
My situation is that I have a large association (ByteCount 100Gb constructed from sequences in the human genome) that I am using as a hash table because the performance combination of Lookup with Associations is spectacular.  Even with the amazing performance mentioned, I still expect the querying of the association to be a bottleneck because of the number of queries to the association that is needed to process multiple datasets of experimental data.&#xD;
&#xD;
My experience with ParallelTable and friends in Mathematica is that you get the best performance benefit if you are transmitting very little data back and forth between kernels.  If this condition is not met, then the performance of parallel constructs is often worse that their equivalent serial peers.&#xD;
&#xD;
Questions that come to mind:&#xD;
&#xD;
A. Is there any known way of use parallel constructs to query an association that avoids the need for each parallel kernel to have it&amp;#039;s own copy of the association?  (I am looking for concurrent hash table functionality in Mathematica.)&#xD;
&#xD;
B. Since I suspect the answer to Question A is &amp;#034;no&amp;#034;, does anyone know if the good folks at Wolfram are working to improve the capabilities / performance of parallel functionality in Mathematica?  I am not looking for deep insider secrets, but it does seem that attention to this functionality had waned as documentation reveals the last revision for many parallel commands was in 2010.&#xD;
&#xD;
C. Has anyone used an external concurrent hash table in their own projects that they linked back into Mathematica?  Would you be willing to share your experience?&#xD;
&#xD;
I appreciate your thoughts and advice.&#xD;
&#xD;
Todd</description>
    <dc:creator>Todd Allen</dc:creator>
    <dc:date>2021-07-04T21:18:10Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/977819">
    <title>Handle and report errors in Mathematica?</title>
    <link>https://community.wolfram.com/groups/-/m/t/977819</link>
    <description>I would like to start a discussion on how to best handle errors in Mathematica.&#xD;
&#xD;
You are writing a package that many people will use. They may use your functions interactively, or they may use them inside larger functions they define.  There is an error condition in your functionincorrect input, can&amp;#039;t solve the problem, unexpected failure, etc.  What should your function do?&#xD;
&#xD;
There is already a great post by Leonid about this here:&#xD;
&#xD;
 * http://mathematica.stackexchange.com/a/29323/12&#xD;
&#xD;
I thought it was time to revisit the topic and share some thoughts about how each of us typically handles errors.&#xD;
&#xD;
To get the discussion started, here are some things to think about:&#xD;
&#xD;
 - The error should be communicated in a user-friendly manner to interactive users&#xD;
 - There should be an easy way to catch and handle the error programmatically&#xD;
 - It should be easy to track down where the error occurred in a large code block (e.g. function `X` should associate its messages with `X`)&#xD;
&#xD;
Typical ways used by builtins:&#xD;
&#xD;
 - Issue a message and stay unevaluated (e.g. `Integral`) (not friendly to programmatic error handling)&#xD;
 - Return `$Failed`, with or without an accompanying message&#xD;
 - Return `Failure[...]` (e.g. `Interpreter`)&#xD;
 - `Throw` something (not friendly to interactive users)&#xD;
 - Some functions are designed in such a way as to never error out, e.g. most `Q` functions, like `OddQ`, will always return `True` or `False` and just return `False` for input that one might consider inappropriate.&#xD;
&#xD;
There are multiple challenges to implementing each, as well as handling each type of error.</description>
    <dc:creator>Szabolcs Horvát</dc:creator>
    <dc:date>2016-12-10T17:59:32Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/516227">
    <title>Is this the best programming style for prototyping a ray tracer</title>
    <link>https://community.wolfram.com/groups/-/m/t/516227</link>
    <description>*Vitaliy Kaurov suggested that I cross post this [StackExchange original][1] here.*&#xD;
&#xD;
I am trying out Mathematica as a prototyping tool.  As an initial exercise I have put together a brute force ray tracer, with a view to using Mathematica&amp;#039;s built in probability distribution functions to test out some fancy shaders.  (My starting point was the F# ray tracer available http://code.msdn.microsoft.com/ParExtSamples.)&#xD;
&#xD;
As this is a first attempt at using Mathematica, other than as a fancy calculator, I would welcome some **guidance or critique on whether this coding style is going to be effective**.  (You will detect from the code that I am accustomed to an object-oriented paradigm.)&#xD;
&#xD;
My own observations, in no particular order, are:&#xD;
&#xD;
 1. It&amp;#039;s an enjoyable way to work, as a lot of the busy type definitions and additional syntax required by other languages is not needed here; the code is quite compact and the intention fairly readable (IMHO).&#xD;
 2. I have built the ray tracer from scratch, without using the ***built-in graphics primitives*** as that would defeat the learning purpose of the exercise and I would probably not be able to roll my own shaders.  As a simple example, addition is not defined for RGBColor, for example.&#xD;
 3. Probably as a consequence, the tracer is very slow, even if I use all the 4 kernels that are available to me.  I dare say that the existing code could be speeded up considerably by removing all the type / pattern matching, but the code would be much harder to follow, I think, and certainly much harder to debug.  My approach seems to mean that I cannot take advantage of Compile optimization, so far as I can see.  If I wanted a fast ray tracer I would write it in C++, but I wonder whether there are any **easy optimizations that I have missed** (and that don&amp;#039;t involve mangling what I have to the extent that the prototyping benefits of Mathematica -- easy refactoring -- would be lost).  However, I am surprised that even with 4 kernels, the cpu of this 4-core (8-core, if you count hyperthreading) never maxes out.  For example, is it worth changing some of the `:=` to `=`?  Things would be even slower if I aliased the results by averaging 4 adjacent traces, for example.  **Real time ray tracing** seems out of reach.&#xD;
 4. Ray tracing results in a lot of &amp;#034;corner cases&amp;#034; that are dealt with naturally with **IEEE maths**.  Unfortunately Mathematica does produce +/-Infinity for +/-1/0, for example, so some of the code should really be extended to treat those cases properly.&#xD;
 5. It would be great if Mathematica had more built-in ***vector algebra*** so that I could write the equations defining the objects and the rays involved and getting Mathematica to calculate the ray intersection points that are at the heart of the ray tracer.  As things stand, `Reduce` and `Solve` have not helped me to find better intersection algorithms, producing either nothing at all or something large an unintelligible, depending on how I posed the problem.&#xD;
&#xD;
Anyway, here is what you get after 110s from `raytrace[400, 400, basescene, 6]`:&#xD;
&#xD;
![Here is what you get after 110s from `raytrace[400, 400, basescene, 6]`][2]&#xD;
&#xD;
&#xD;
... and here is the code:&#xD;
&#xD;
&#xD;
		(* Colour helpers *)&#xD;
		black = {0., 0., 0.};&#xD;
		darkgrey = {.25, .25, .25};&#xD;
		grey = {.5, .5, .5};&#xD;
		white = {1., 1., 1.};&#xD;
		background = black;&#xD;
		defaultcolor = black;&#xD;
		&#xD;
		brightness[{r_, g_, b_}] = Mean[{r, g, b}]; &#xD;
		    &#xD;
		scale[k_, c: {r_, g_, b_}] = k * c;&#xD;
		&#xD;
		zero = {0.,0.,0.};&#xD;
		&#xD;
		(* Mainly for reference; pattern matching normally used instead *)&#xD;
		&#xD;
		ray /: start[ray[s_, d_]] = s;&#xD;
		ray /: dir[ray[s_, d_]] = d;&#xD;
		&#xD;
		camera /: pos[camera[p_, l_]] = p;&#xD;
		camera /: lookat[camera[p_, l_]] = l;&#xD;
		camera /: forward[camera[p_, l_]] = Normalize[l - p];&#xD;
		camera /: down[camera[p_, l_]] = {0., -1., 0.};&#xD;
		camera /: right[c : camera[p_, l_]] := 1.5 * Normalize[Cross[forward[c], down[c]]];&#xD;
		camera /: up[c : camera[p_, l_]] := 1.5 * Normalize[Cross[forward[c], right[c]]];&#xD;
		&#xD;
		&#xD;
		light /: pos[light[p_, c_]] = p;&#xD;
		light /: color[light[p_, c_]] = c;&#xD;
		&#xD;
		scene /: things[scene[t_, l_, c_]] = t;&#xD;
		scene /: lights[scene[t_, l_, c_]] = l;&#xD;
		scene /: camera[scene[t_, l_, c_]] = c;&#xD;
		    &#xD;
		surface /: diffuse[surface[d_, s_, re_, ro_]] = d;&#xD;
		surface /: specular[surface[d_, s_, re_, ro_]] = s;&#xD;
		surface /: reflect[surface[d_, s_, re_, ro_]] = re;&#xD;
		surface /: roughness[surface[d_, s_, re_, ro_]] = ro;&#xD;
		&#xD;
		intersection /: thing[intersection[t_, r_, d_]] = t;&#xD;
		intersection /: ray[intersection[t_, r_, d_]] = r;&#xD;
		intersection /: dist[intersection[t_, r_, d_]] = d;&#xD;
		miss = intersection[nothing, ray[zero, zero], Infinity];&#xD;
		&#xD;
		sceneobject /: surface[sceneobject[s_, i_, n_]] = s;&#xD;
		sceneobject /: intersect[sceneobject[s_, i_, n_]] = i;&#xD;
		sceneobject /: normal[sceneobject[s_, i_, n_]] = n;&#xD;
		&#xD;
		sphere /: center[sphere[c_, r_, s_]] = c;&#xD;
		sphere /: radius[sphere[c_, r_, s_]] = r;&#xD;
		sphere /: surface[sphere[c_, r_, s_]] = s;&#xD;
		normal[sphere[center_, _, _], pos_] = Normalize[pos - center];&#xD;
		&#xD;
		plane /: normal[plane[n_, o_, s_]] = n;&#xD;
		plane /: offset[plane[n_, o_, s_]] = o;&#xD;
		plane /: surface[plane[n_, o_, s_]] = s;&#xD;
		normal[plane[n_, _, _], _] = n;&#xD;
		           &#xD;
		(* Axis-aligned bounding box *)&#xD;
		(* TODO: not yet used; integrate into tracer *)&#xD;
		box /: lowerb[box[l_, u_]] := l;&#xD;
		box /: upperb[box[l_, u_]] := u;&#xD;
		&#xD;
		extendby[box[l_, u_], pt_] :=&#xD;
		    box[MapThread[Min, {l, pt}], MapThread[Max, {u, pt}]];&#xD;
		size[box[l_, u_]] :=&#xD;
		    u - l;&#xD;
		majoraxis[b : box[l_, u_]] :=&#xD;
		    Ordering[size[b], -1]; &#xD;
		&#xD;
		&#xD;
		(* TODO: This does not work for cases where dir has 0 compnent as Mathematic returns ComplexInfinity,&#xD;
		   not +/-Infinity for +/-1/0 *)&#xD;
		intersectboxQ[b : box[l_, u_], r : ray[start_, dir_]] :=&#xD;
		    Module[ {tl = (l - start) / dir, tu = (u - start) / dir, tmin, tmax},&#xD;
		        &#xD;
		        (* Swap u[i] and l[i] if dir[i] &amp;lt; 0 to avoid &#xD;
		           erroneous result because 0 == -0 *)&#xD;
		        tmin = Max[MapThread[Min, {tu, tl}]];&#xD;
		        tmax = Min[MapThread[Max, {tu, tl}]];&#xD;
		        Not[tmax &amp;lt; 0 &amp;amp;&amp;amp; tmin &amp;gt; tmax];&#xD;
		    (* Use Not to cover some Infinity comparisons *)&#xD;
		        &#xD;
		    (*  Which[&#xD;
		        tmax &amp;lt; 0, False, (* Intersection at t = tmax, but it&amp;#039;s behind us *)&#xD;
		        tmin &amp;gt; tmax, False, (* No intersection *)&#xD;
		        True, True (* Interesection at t = tmin *)&#xD;
		        ]*)&#xD;
		    ];&#xD;
		&#xD;
		&#xD;
		&#xD;
		intersect[s : sphere[center_, radius_, _], r : ray[start_, dir_], i : intersection[_, _, currentdist_]] :=&#xD;
		    Module[ {eo = center-start, v, dist, disc},&#xD;
		        v = eo.dir;&#xD;
		        dist = If[ v &amp;lt; 0.,&#xD;
		                   0.,&#xD;
		                   disc = radius * radius - (eo.eo - v * v);&#xD;
		                   If[ disc &amp;lt; 0.,&#xD;
		                       0.,&#xD;
		                       v - Sqrt[disc]&#xD;
		                   ]&#xD;
		               ];&#xD;
		        If[ dist == 0. || dist &amp;gt; currentdist,&#xD;
		            i,&#xD;
		            intersection[s, r, dist]&#xD;
		        ]&#xD;
		    ];&#xD;
		&#xD;
		&#xD;
		intersect[p : plane[norm_, offset_, _], r : ray[start_, dir_], i : intersection[_, _, currentdist_]] :=&#xD;
		    Module[ {denom =  norm . dir, candidatedist},&#xD;
		        If[ denom &amp;gt;= 0.,&#xD;
		            i,&#xD;
		            candidatedist = (norm . start + offset) / (-denom);&#xD;
		            If[ candidatedist &amp;gt; currentdist,&#xD;
		                i,&#xD;
		                intersection[p, r, candidatedist]&#xD;
		            ]&#xD;
		        ]&#xD;
		    ];&#xD;
		 &#xD;
		      &#xD;
		testray[ray_, scene_] :=&#xD;
		    dist[Fold[intersect[#2, ray, #1]&amp;amp;, miss, things[scene]]];&#xD;
		&#xD;
		     &#xD;
		traceray[ray_, scene_, depth_, maxdepth_] :=&#xD;
		    shade[Fold[intersect[#2, ray, #1]&amp;amp;, miss, things[scene]], scene, depth, maxdepth];&#xD;
		&#xD;
		&#xD;
		shade[miss, _, _, _] :=&#xD;
		    background;     &#xD;
		shade[intersection[thing_, ray[start_, dir_], dist_], scene_, depth_, maxdepth_] :=&#xD;
		    Module[ {pos = dist * dir + start, n, reflectdir, naturalcolor, reflectedcolor},&#xD;
		        n = normal[thing, pos];&#xD;
		        reflectdir = dir - 2. * n . dir * n;&#xD;
		        naturalcolor = defaultcolor + getnaturalcolor[thing, pos, n, reflectdir, scene];&#xD;
		        reflectedcolor = If[ depth &amp;gt;= maxdepth,&#xD;
		                             grey,&#xD;
		                             getreflectioncolor[thing, pos + (0.001*reflectdir), n, &#xD;
		                                 reflectdir, scene, depth, maxdepth]&#xD;
		                         ];&#xD;
		        naturalcolor + reflectedcolor&#xD;
		    ];&#xD;
		     &#xD;
		getreflectioncolor[thing_, pos_, n_, rd_, scene_, depth_, maxdepth_] :=&#xD;
		    reflect[surface[thing]][pos] *&#xD;
		    traceray[ray[pos, rd], scene, depth + 1, maxdepth];&#xD;
		             &#xD;
		getnaturalcolor[thing_, pos_, n_, rd_, scene_] :=&#xD;
		    Module[ {addlight, normraydir = Normalize[rd], howrough = roughness[surface[thing]]},&#xD;
		        SetAttributes[addlight, Listable];&#xD;
		        addlight[light[p_, c_]] :=&#xD;
		            Module[ {ldis = p - pos, livec, neatisect, isinshadow, illum, lcolor, spec, scolor},&#xD;
		                livec = Normalize[ldis];&#xD;
		                neatisect = testray[ray[pos, livec], scene];&#xD;
		                isinshadow = neatisect &amp;lt;= Norm[ldis];&#xD;
		                If[ isinshadow,&#xD;
		                    defaultcolor,&#xD;
		                    illum = livec . n;&#xD;
		                    lcolor = If[ illum &amp;gt; 0.,&#xD;
		                                 illum * c,&#xD;
		                                 defaultcolor&#xD;
		                             ];&#xD;
		                    spec = livec . normraydir;&#xD;
		                    scolor = If[ spec &amp;gt; 0.,&#xD;
		                                 (spec ^ howrough) * c,&#xD;
		                                 defaultcolor&#xD;
		                             ];&#xD;
		                    diffuse[surface[thing]][pos] * lcolor + specular[surface[thing]][pos] * scolor&#xD;
		                ]&#xD;
		            ];&#xD;
		        defaultcolor + Total[addlight[lights[scene]]]&#xD;
		    ];&#xD;
		         &#xD;
		 &#xD;
		&#xD;
		 raytrace[screenwidth_ : 64, screenheight_ : 64, scene_ : basescene, maxdepth_ : 1] :=&#xD;
		     Module[ {getpoint},&#xD;
		         getpoint[x_, y_, camera_] :=&#xD;
		             With[ {recenterx = (x - screenwidth / 2.) / (2. * screenwidth), &#xD;
		             recentery = -(y - screenheight / 2.) / (2. * screenheight)},&#xD;
		                 Normalize[forward[camera] + recenterx * right[camera] + recentery * up[camera]]&#xD;
		             ];&#xD;
		         Image[ParallelArray[traceray[ray[pos[camera[scene]], getpoint[#2-1, #1-1, camera[scene]]], &#xD;
		             scene, 0, maxdepth]&amp;amp;, {screenheight, screenwidth}]] // AbsoluteTiming&#xD;
		     ];&#xD;
		 &#xD;
		 &#xD;
		 (* Harness *)&#xD;
		 &#xD;
		(* surface diffuse, specular reflect, roughness *)&#xD;
		uniformsurface[diffuse_, specular_, reflect_, roughness_] = surface[diffuse&amp;amp;, specular&amp;amp;, reflect&amp;amp;, roughness];&#xD;
		 &#xD;
		shiny = uniformsurface[white, grey, .7, 250.];&#xD;
		matteshiny = uniformsurface[white, darkgrey, .7, 250.];&#xD;
		&#xD;
		checkerboard =&#xD;
		    surface[&#xD;
		    If[ OddQ[Floor[#[[3]]] + Floor[#[[1]]]],&#xD;
		        white,&#xD;
		        black&#xD;
		    ]&amp;amp;, &#xD;
		    white &amp;amp;, &#xD;
		    If[ OddQ[Floor[#[[3]]] + Floor[#[[1]]]],&#xD;
		        .1,&#xD;
		        .7&#xD;
		    ]&amp;amp;, &#xD;
		    150.];&#xD;
		 &#xD;
		 &#xD;
		 &#xD;
		 basescene = scene[{  &#xD;
		     sphere[{0., 1., -.25}, 1., shiny], &#xD;
		          sphere[{-.5, 1.3, 1.5}, 0.5, matteshiny],&#xD;
		     plane[{0., 1., 0.}, 0., checkerboard]},&#xD;
		      {light[{-2., 2.5, 0.}, {.5,.45,.41}], light[{2.,4.5,2.},{.99,.95,.8}]},&#xD;
		      camera[{2.75, 2.0, 3.75}, {-.6, .5, 0.}]];&#xD;
		      &#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
To illustrate where I am going with this, here is an example of how one could generate a mesh for a more complex object (a polysphere):&#xD;
&#xD;
		polyspherepoints[rad_Real, divs_Integer] :=&#xD;
		    With[ {u = -(Pi/2.), v = -Pi, &#xD;
		      du = Pi/divs, dv = (2.*Pi)/divs},&#xD;
		        rad * &#xD;
		         Flatten[Table[{Cos[du*i + u]*Cos[dv*j + v], Sin[du*i + u], &#xD;
		            Cos[du*i + u]*Sin[dv*j + v]}, {j, 0, divs}, {i, 0, &#xD;
		        divs}], 1]&#xD;
		    ];&#xD;
		&#xD;
		(* Put the polygon vertices in the right order *)&#xD;
		ordervertices[{{a_, b_}, {c_, d_}}] :=&#xD;
		    {a, b, d, c};&#xD;
		&#xD;
		orderverticestotriangeles[{{a_, b_}, {c_, d_}}] :=&#xD;
		{{a, b, d}, {a, c, d}}&#xD;
		&#xD;
		(* Generate a list of (polyspherepoint) vertice numbers, &#xD;
		   partition them cyclically, and then into quads, and associate them&#xD;
		   with Polygons *)&#xD;
		   &#xD;
		polyspheremeshtriangles[rad_Real, divs_Integer] :=&#xD;
		    Normal @ GraphicsComplex[polyspherepoints[rad, divs], &#xD;
		      Map[Polygon, &#xD;
		       Map[orderverticestotriangeles,&#xD;
		         Partition[Partition[Range[(divs+1)^2], divs+1], {2, 2}, 1, 1], {2}], 1]]; &#xD;
		   &#xD;
		polyspheremeshtriangles[rad_Real, divs_Integer] :=&#xD;
		    Normal @ GraphicsComplex[polyspherepoints[rad, divs], &#xD;
		      Map[Polygon, &#xD;
		       Map[orderverticestotriangeles,&#xD;
		         Partition[Partition[Range[(divs+1)^2], divs+1], {2, 2}, 1, 1], {2}], 1]];&#xD;
		         		 &#xD;
&#xD;
(It would have been satisfying to use some of the geometric transform functions built into Mathematica to generate the vertices, but life was too short.)&#xD;
&#xD;
And here is what `Graphics3D @ polyspheremeshtriangles[1., 8]` generates:&#xD;
&#xD;
![PolySphere, of trianges][3]&#xD;
&#xD;
&#xD;
  [1]: http://mathematica.stackexchange.com/questions/48675/is-this-the-most-effective-and-efficient-programming-style-for-prototyping-a-ra&#xD;
  [2]: http://i.stack.imgur.com/AZE08.png&#xD;
  [3]: http://i.stack.imgur.com/RU6dD.png</description>
    <dc:creator>jr p</dc:creator>
    <dc:date>2015-06-20T11:53:40Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3222475">
    <title>&amp;#034;SuiteSparseMatrix&amp;#034; appears broken?</title>
    <link>https://community.wolfram.com/groups/-/m/t/3222475</link>
    <description>Running official notebook from https://resources.wolframcloud.com/FunctionRepository/resources/SuiteSparseMatrix/  fails on `ssm = ResourceFunction[&amp;#034;SuiteSparseMatrix&amp;#034;][&amp;#034;ash85&amp;#034;]` with the following error&#xD;
&#xD;
![enter image description here][1]&#xD;
It appears trying to retrieve `ash85` gives an array of shape `(1, 0)` at some point.&#xD;
&#xD;
Can anyone see a simple fix so that I can run this locally?&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2024-07-16at1.12.50%E2%80%AFPM.png&amp;amp;userId=1046145</description>
    <dc:creator>Yaroslav Bulatov</dc:creator>
    <dc:date>2024-07-16T20:13:38Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2940172">
    <title>Issue with ConcaveHullMesh function</title>
    <link>https://community.wolfram.com/groups/-/m/t/2940172</link>
    <description>I think I may have stumbled across an issue with Mathematica’s built-in ConcaveHullMesh function that doesn’t seem to arise with Jon McLoone&amp;#039;s NonConvexHullMesh resource function.  The issue is illustrated in the attached notebook.  My guess is that it occurs when the point values are modestly large (fairly typical of cartographical coordinate systems) and/or the number of points exceeds some threshold (noting that the function works when I take a small sample from the point dataset).&#xD;
&#xD;
From what I’m seeing, it looks like Jon&amp;#039;s resource function may be more robust than the built-in function.&#xD;
&#xD;
Any thoughts or solutions other than what I&amp;#039;ve already tried would be welcomed.&#xD;
&#xD;
Many thanks,&#xD;
&#xD;
Ian&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/0941c754-35d6-4c37-b6de-464f0b97877d</description>
    <dc:creator>Ian Williams</dc:creator>
    <dc:date>2023-06-20T16:50:15Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2931747">
    <title>How to fix an error when using &amp;lt;&amp;lt; in a paclet kernel file</title>
    <link>https://community.wolfram.com/groups/-/m/t/2931747</link>
    <description>I often ask for help on Wolfram Community, but this time I have some help to give that I hope will be helpful for others having the same problem.  &#xD;
I build a paclet and I get an error with Get.  &#xD;
&#xD;
    ref/message/General/noopen Cannot open PeterBurbery`LittleChildPaclet`Coins`.&#xD;
&#xD;
and many other errors.  &#xD;
&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
I fix the error with&#xD;
&#xD;
    PacletDirectoryLoad[&amp;#034;C:\\Users\\Peter\\OneDrive - Marshall University\&#xD;
    \\GitHub\\wolfram-challenges-paclet\\little-child-paclet&amp;#034;]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
This shows how the error is resolved.&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][3]&#xD;
&#xD;
The error appears again when I run PacletDirectoryUnload.&#xD;
&#xD;
I found another way to load a paclet. This sometimes works when other methods fail.&#xD;
&#xD;
    Get /@ FileNames[&amp;#034;*.wl&amp;#034;, &#xD;
       &amp;#034;C:\\Users\\Peter\\OneDrive - Marshall \&#xD;
    University\\GitHub\\basic-hypergeometric-functions-paclet\\basic-\&#xD;
    hypergeometric-functions\\Kernel&amp;#034;];&#xD;
I had to run this twice to get it to work.&#xD;
&#xD;
Here is something that works better.&#xD;
&#xD;
    Do[Quiet[&#xD;
      Get /@ FileNames[&amp;#034;*.wl&amp;#034;, &#xD;
         &amp;#034;C:\\Users\\Peter\\OneDrive - Marshall \&#xD;
    University\\GitHub\\basic-hypergeometric-functions-paclet\\basic-\&#xD;
    hypergeometric-functions\\Kernel&amp;#034;];, Get::noopen], 4]&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/efb57ee5-1003-483c-900c-b57ba5bc5204&#xD;
  [2]: https://www.wolframcloud.com/obj/7ade610b-76e2-4f56-b459-4859cc83f23b&#xD;
  [3]: https://www.wolframcloud.com/obj/a3f953ca-b965-4965-96cb-c019aa73c6b8</description>
    <dc:creator>Peter Burbery</dc:creator>
    <dc:date>2023-06-07T00:46:23Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2759635">
    <title>Memory issues with ParallelMap</title>
    <link>https://community.wolfram.com/groups/-/m/t/2759635</link>
    <description>Hi,&#xD;
&#xD;
I have a looped function, which includes a Map operation, that I&amp;#039;ve optimized for serial computation whose computation time grows roughly proportional to (N^2+N)/2, where N is the length of the loop. The bottle neck happens at the Map operation, so I do&#xD;
&#xD;
    DistributeDefinitions[F, ..., from];&#xD;
    ParallelMap[F[...], from, Method-&amp;gt;&amp;#034;CoarsestGrained&amp;#034;];&#xD;
&#xD;
That works fine except every time I do a new ParallelMap the amount of memory the kernels are using grows until Mathematica crashes (and I have 64 GB of RAM...). &#xD;
&#xD;
Sadly, I find the documentation on parallel processing in Mathematica to be the poorest part of the documentation, mostly because the examples are far too simple (they are also all numeric - I&amp;#039;m doing symbolic computations) but also because there is no documentation on &amp;#034;Parallel`Developer`&amp;#034; nor the functions it contains, and no discussion on managing subkernel memory.&#xD;
&#xD;
At the beginning of my program I set HistoryLength = 0; and disable caching (which does not benefit what I&amp;#039;m doing - that&amp;#039;s a different discussion). Those two things only effect the main kernel. So would &amp;#034;ParallelEvaluate[$HistoryLength = 0];&amp;#034; set the history length for the subkernels to 0 (if not we need an option somewhere to do it, assuming the subkernels have a history)? &#xD;
&#xD;
I know I could prevent this problem by quitting the subkernels and relaunching them, but that has a huge overhead cost (~ N  AbsoluteTiming[LaunchKernels[]]) and would wipe-out any gains from parallel processing. I have tried &amp;#034;ClearKernels[]&amp;#034; but that doesn&amp;#039;t fix the memory problem. So, should I change my code to&#xD;
&#xD;
    ClearDistributedDefinitions[]; DistributeDefinitions[F, ..., from];&#xD;
    ParallelMap[F[...], from, Method-&amp;gt;&amp;#034;CoarsestGrained&amp;#034;];&#xD;
&#xD;
Is there anything else I should try?</description>
    <dc:creator>Troy Wahl</dc:creator>
    <dc:date>2023-01-04T19:04:55Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2733766">
    <title>ListContourPlot3D problems in 13.2.0</title>
    <link>https://community.wolfram.com/groups/-/m/t/2733766</link>
    <description>I&amp;#039;m seeing some significant problems with ListContourPlot3D since version 13.1.0 when viewing signed distance fields (SDFs). Version 13.0.1 produces nice output:&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][5]&#xD;
 &#xD;
In 13.1.0:&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
In 13.2.0:&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
I have tried increasing MaxPlotPoints, but it doesn&amp;#039;t help much.&#xD;
&#xD;
The &amp;#034;9999.bin&amp;#034; data file can be found [here][4].&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=plot_13_0_1.png&amp;amp;userId=2732343&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=plot_13_1_0.png&amp;amp;userId=2732343&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=plot_13_2_0.png&amp;amp;userId=2732343&#xD;
  [4]: https://1drv.ms/u/s!Apg07cGOQDoehZZQpd7acKkjpJFGiQ?e=B57Yuu&#xD;
  [5]: https://www.wolframcloud.com/obj/8eb6bdee-8634-44fc-a774-d24a8d9205f5</description>
    <dc:creator>Eric Parker</dc:creator>
    <dc:date>2022-12-16T23:55:11Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2599137">
    <title>Unexpected behavior with ListContourPlot3D and ArrayPlot3D</title>
    <link>https://community.wolfram.com/groups/-/m/t/2599137</link>
    <description>I had previously raised [a question][1] regarding ListContourPlot3D but got no response. For some work i need contours (base on discrete data) in combination with Image3D, which i had working previously. &#xD;
&#xD;
No to make this work i need to jump some hoops to make it work. &#xD;
While looking for alternatives i also looked at ArrayPlot3D where i found some strange behavior also. &#xD;
&#xD;
I am aware of all the different axes conventions Mathematica uses for Images, Graphics, Arrays, Matrixes etc. (would be nice to have a nice guide on this topic since its getting confusing), but based on my experience here there are some internal size and dimension flips for these functions that are unintended. &#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]  &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com/groups/-/m/t/2561444?p_p_auth=Rh92C58n&#xD;
  [2]: https://www.wolframcloud.com/obj/4e1558ce-b542-4337-aa9c-6b54e1130e71</description>
    <dc:creator>Martijn Froeling</dc:creator>
    <dc:date>2022-08-16T12:01:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2309593">
    <title>A suspected Echo and Print issue with newline</title>
    <link>https://community.wolfram.com/groups/-/m/t/2309593</link>
    <description>*Postscript after writing this post: I thought I found a bug in Echo and Print. But in fact it was my mistake to misunderstand &amp;#034;Row&amp;#034;.*&#xD;
&#xD;
&#xD;
In all my programs I use a global variable testLvl with which I can control echo outputs. I.e.: I can write:&#xD;
&#xD;
    testLvl = 3;&#xD;
    (* ... *)&#xD;
    If[testLvl &amp;gt;= 3, Echo[expr1, label1]]; &#xD;
    If[testLvl &amp;gt;= 4, Echo[expr2, label2]];&#xD;
![enter image description here][1]&#xD;
&#xD;
To shorten this further, I have my own echo routine that essentially includes this query of testLvl:&#xD;
&#xD;
    ClearAll[echo];&#xD;
    echo[expr_, label_ : &amp;#034;&amp;#034;, lvl0_Integer : 3] :=&#xD;
      If[testLvl &amp;gt;= lvl0,&#xD;
       Echo[expr, Row[{{testLvl, lvl0}, &amp;#034;: &amp;#034;, label}]]&#xD;
       , expr];&#xD;
    &#xD;
    testLvl = 3;&#xD;
    (* ... *)&#xD;
    echo[expr1, label1];&#xD;
    echo[expr2, label2, 4];&#xD;
    &#xD;
    testLvl = 4;&#xD;
    (* ... *)&#xD;
    echo[expr1, label1];&#xD;
    echo[expr2, label2, 4];&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
In doing so, I ran into the following problem within my echo routine:&#xD;
&#xD;
The label in Echo[expr, label] should be any expression. According to the documentation it does not have to be a String. Therefore, it could be any Row as an example. &#xD;
&#xD;
This works:&#xD;
&#xD;
    Echo[E, &amp;#034;1.: E - Label as a String: &amp;#034;]; &#xD;
    Echo[E, Row[{2, &amp;#034;.: E&amp;#034;, &amp;#034; - Label as a Row: &amp;#034;}]]&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
If newlines appear in a String label, Echo still works fine (except for the indentation of the expression):&#xD;
&#xD;
    Echo[N[E], &amp;#034;3.: N[E]\nLabel as a String:\n&amp;#034;]&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
But when newlines occur in a non-string label, say a Row label, a problem occurs. **The label is split and the expression appears somewhere in between**:&#xD;
&#xD;
    Echo[N[E], Row[{4, &amp;#034;.: N[E]\nLabel as a Row:\n&amp;#034;}]]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
I was afraid this is a Print bug. In any case, **Print shows the same (assumed mis-) behavior**:&#xD;
&#xD;
    Print[Row[{5, &amp;#034;.: N[E]\nLabel as a Row:\n&amp;#034;}], N[E]]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
It occurs when Print outputs not only a pure Row or a sequence of expressions. Otherwise everything is fine:&#xD;
&#xD;
    Print[6, &amp;#034;.: N[E]\nLabel as a String:\n&amp;#034;, N[E]];&#xD;
    Print[Row[{7, &amp;#034;.: N[E]\nLabel as a String:\n&amp;#034;, N[E]}]];&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
Print&amp;#039;s documentation says that Print[expr1,expr2,...] concatenates the expressions and effectively uses Row. I.e.: Print[Row[{expr1,expr2,...}]] should output the same. This remains true if one of the expressions is itself a Row, but the result seems wrong at first sight:&#xD;
&#xD;
    Print[Row[{8, &amp;#034;a.: N[E],\nLabel as a String:&amp;#034;, &amp;#034;\n&amp;#034;}], N[E]];&#xD;
    Print[Row[{Row[{8, &amp;#034;b.: N[E],\nLabel as a String:&amp;#034;, &amp;#034;\n&amp;#034;}], N[E]}]];&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
It wasn&amp;#039;t until I was writing this post that **I realized I had misunderstood &amp;#034;Row&amp;#034; in this context**, since Row exhibits the same behavior. The elements of Row are not simply concatenated like in a typewriter, but each part is formatted separately in StandardForm (line wrapping if necessary) and the individual results are concatenated:&#xD;
&#xD;
    Row[{Row[{8, &amp;#034;bR.: N[E],\nLabel as a String:&amp;#034;, &amp;#034;\n&amp;#034;}], N[E]}]&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
Going back to my original problem (see example 4 above) you just have to convert the label to a String to fix it. Of course, you can then no longer place arbitrary expressions in the label, but only those that can be meaningfully converted to a string. To solve our newline problem, it is better to use EchoFunction  when the label ends with a newline:&#xD;
&#xD;
    Echo[N[E], Row[{4, &amp;#034;.: N[E]\nLabel as a Row:\n&amp;#034;}]];&#xD;
    Echo[N[E], &#xD;
      ToString@Row[{9, &#xD;
         &amp;#034;. = 4.Fixed: N[E]\nLabel as a Row converted to String:\n&amp;#034;}]];&#xD;
    EchoFunction[&#xD;
       Row[{Style[&#xD;
           Row[{10, &amp;#034;. = 4.Fixed: N[E]\nLabel as a Row echoed with \&#xD;
    EchoFunction:&amp;#034;}], &amp;#034;EchoLabel&amp;#034;],&#xD;
          &amp;#034;\n&amp;#034;, #}] &amp;amp;][N[E]];&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
Because it is difficult to determine in the general case whether a label ends with a newline, I make a new function echoNl that brings the expression under the label:&#xD;
&#xD;
    ClearAll[echoNl];&#xD;
    echoNl[expr_, label_ : &amp;#034;&amp;#034;, lvl0_Integer : 3] := Module[{myLbl},&#xD;
       If[testLvl &amp;gt;= lvl0,&#xD;
        myLbl = Row[{{testLvl, lvl0}, &amp;#034;: &amp;#034;, label}];&#xD;
        EchoFunction[Row[{Style[myLbl, &amp;#034;EchoLabel&amp;#034;], &amp;#034;\n&amp;#034;, #}] &amp;amp;][expr]&#xD;
        , expr]&#xD;
       ];&#xD;
    &#xD;
    testLvl = 3;&#xD;
    (* ... *)&#xD;
    echoNl[expr1, label1];&#xD;
    echo[expr2, label2, 4];&#xD;
    &#xD;
    testLvl = 4;&#xD;
    (* ... *)&#xD;
    echoNl[expr1, label1];&#xD;
    echo[expr2, label2, 4];&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
**This is my final solution**.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b01.jpg&amp;amp;userId=890153&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b02.jpg&amp;amp;userId=890153&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b03.jpg&amp;amp;userId=890153&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b04.jpg&amp;amp;userId=890153&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b05.jpg&amp;amp;userId=890153&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b06.jpg&amp;amp;userId=890153&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b07.jpg&amp;amp;userId=890153&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b08.jpg&amp;amp;userId=890153&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b09.jpg&amp;amp;userId=890153&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b10.jpg&amp;amp;userId=890153&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b11.jpg&amp;amp;userId=890153&#xD;
  [12]: https://www.wolframcloud.com/obj/590922d3-982f-4008-95d8-0e755af7bc83</description>
    <dc:creator>Werner Geiger</dc:creator>
    <dc:date>2021-07-11T17:39:52Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2171196">
    <title>CUDA working but NetTrain[~,&amp;#034;TargetDevice&amp;#034;-&amp;gt;&amp;#034;GPU&amp;#034;] doesn&amp;#039;t</title>
    <link>https://community.wolfram.com/groups/-/m/t/2171196</link>
    <description>Am I supposed to do a different command within NetTrain[] to use CUDA or is &amp;#034;TargetDevice&amp;#034;-&amp;gt;&amp;#034;GPU&amp;#034; still supposed to work? (CUDA examples evaluate successfully.)&#xD;
&#xD;
The net gets trained but CPU spikes to 56% from a baseline of 1% while the NetTrain is evaluated and GPU does not seem to get used.&#xD;
&#xD;
Gfx: Nvidia 2080Ti&#xD;
CPU: AMD 3950x&#xD;
Wolfram v. 12.2&#xD;
&#xD;
Never mind: I think it is working now.</description>
    <dc:creator>Renay Oshop</dc:creator>
    <dc:date>2021-01-23T13:25:47Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3635801">
    <title>Kernel freeze when changing AudioGenerator noise color</title>
    <link>https://community.wolfram.com/groups/-/m/t/3635801</link>
    <description>I have a few code samples which freeze or crash my kernel on evaluation, can anybody confirm that this isn&amp;#039;t a local issue for me?&#xD;
&#xD;
Discrete:&#xD;
&#xD;
    AudioGenerator[{&amp;#034;Color&amp;#034;, AudioGenerator[TimeSeries[{1}, {1}]]}]&#xD;
&#xD;
Continuous:&#xD;
&#xD;
    AudioGenerator[{&amp;#034;Color&amp;#034;, AudioGenerator[{&amp;#034;Sawtooth&amp;#034;, .4, 5}]}]</description>
    <dc:creator>Joseph Stocke</dc:creator>
    <dc:date>2026-02-06T21:20:51Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3562641">
    <title>Mathematica 12, BenchmarkReport[] fails at FFT where it previuosly was fine.  Win 11 upgraded on VM</title>
    <link>https://community.wolfram.com/groups/-/m/t/3562641</link>
    <description>**The problem**&#xD;
&#xD;
I run Mathematica 12 from home via a Win11 VM on Proxmox.  This configuration has run fine for years.  Recently during an upgrade to Win11 25H2 I went to test to make sure everything was functional with a quick BenchmarkReport[] but it caused the kernel to die at Test 3, FFT.  Its a very repeatable failure.&#xD;
&#xD;
Just before upgrading to 25H2 I had changed my processor type for this VM to x86-64-v3 +aes from -v2 + aes. I had issues on another vm where Win11 didnt want to upgrade with v2.&#xD;
I didnt originally run the processor as &amp;#034;host&amp;#034; as I am running dual E5-2699v4 Xeons, Win11 doesnt support by age despite having all the instructions needed.&#xD;
&#xD;
I have used this VM with Win10 and Win11 for years running Mathematica without issue.  In the past I would use BenchmarkReport[] as a quick check of functionality after any upgrades or changes.  This is the first time its failed.&#xD;
&#xD;
A quick test using ParallelTable[sin[x],{x,0,pi,10^-6}] works fine&#xD;
&#xD;
A quick test of Fourier[{1, 1, 2, 2, 1, 1, 0, 0}] works fine&#xD;
&#xD;
But a simple,&#xD;
&#xD;
    Needs[&amp;#034;Benchmark`&amp;#034;]&#xD;
    BenchmarkReport[]&#xD;
&#xD;
Fails while calculating Step 3, FFT.  The kernel simply die with no error message or warning.  If I watch carefully with Task Manager it looks like the kernel dies, Mathematica recreates the kernel, then it dies again immediately.&#xD;
&#xD;
I also tried running this command through mathscript with -verbose but it gives me no additional details why its dying.&#xD;
&#xD;
I went back and tested some older notebooks I had.  One of the first ones I tried died during a NonLinearModelFit of a PieceWise function with Sin[]s.  &#xD;
&#xD;
    Piecewise[{&#xD;
      {&#xD;
       y0 + (&#xD;
         A1 Sin[ 2 \[Pi] ( x - x1)/t1] Sin[ 2 \[Pi] ( x - x2)/t2]&#xD;
         ) + A3 Sin[2 \[Pi] (x - x3)/t3],&#xD;
       x &amp;gt;= xon&#xD;
       },&#xD;
      {y0, x &amp;lt; xon}&#xD;
      }]&#xD;
&#xD;
This had worked in the past but now it dies just like BenchmarkReport, the kernel dies with no errors.&#xD;
&#xD;
**Fixes tried**&#xD;
&#xD;
So, I set the cpu back to v2 + aes for the vm config in proxmox but the kernel still dies.&#xD;
&#xD;
Set the cpu to Host in case its an issue with AES being passed correctly but it still dies&#xD;
&#xD;
I had Ballooning memory on so I turned it off, no change&#xD;
&#xD;
I had NUMA on so I turned it off, no change&#xD;
&#xD;
I uninstalled, reinstalled Mathematica 12.0 but it still fails&#xD;
&#xD;
I installed a demo copy of Mathematica 14.3, BenchmarkReport[] and my notebook run without issue.&#xD;
&#xD;
&#xD;
**System Info**&#xD;
&#xD;
Running a network version of Mathematica 12.0 with MathLM on another VM for the license.  License is for 2 instances and 16 kernels.&#xD;
&#xD;
The VM is running under proxmox 8.4.14.  The vm was just recently upgraded to Win11 25H2 but I am not sure when I last ran BenchmarkReport[].  I have run BenchmarkReport[] on this vm multiple times with some older flavors of win11 but I cant remember when I last ran it.&#xD;
&#xD;
I had recently installed the virtio drivers for this vm on the previous Win11 version but I hadnt run Mathematica since then.  Could be a contributing factor.&#xD;
&#xD;
Proxmox has gone through a recent upgrade with a reboot of the host.  I hadnt tried test Mathematica afterwards.  Could be a contributing factor.&#xD;
&#xD;
The vm has been tested with cpu set to Host, x86-64-v2+aes, x86-64-v3+aes, numa on and off, ballooning on and off, with 32GB memory configured for the vm.  This vm is set to get 2 processors of 8 cores each,&#xD;
&#xD;
The vm is only running microsoft virtual graphic drivers and is only accessed via remote desktop, not SPICE.&#xD;
&#xD;
As far as I can tell Win11 is working as expected.  I am considering a fresh install of Win11 if no better ideas surface.&#xD;
&#xD;
The host system is dual E5-2699 v4 with 512GB.  The host system runs a mix of vms and containers.&#xD;
&#xD;
**Summary**&#xD;
&#xD;
I know this is probably a very weird edge case of using a VM with such an old version of Mathematica.  The kernel dying does seem to fail for more than just Benchmark so its most likely not a single package responsible.  The failure is limited to Mathematica 12 as far as I can tell.  &#xD;
Just wanted to figure this our before I start embarking on a bunch of calculations.&#xD;
&#xD;
Any thoughts are appreciated.</description>
    <dc:creator>Mike Morrell</dc:creator>
    <dc:date>2025-10-19T19:10:08Z</dc:date>
  </item>
</rdf:RDF>

