Place 1/2 of the mushrooms in a food processor, and pulse several times until finely ground. (Don't over process - see notes.) Transfer the ground mushrooms to a bowl, then add the rest of the mushrooms and repeat.
Place the walnuts in the food processor and process until well ground. Add them to the ground mushrooms.
Heat 1 tablespoon of water in a large pot or Dutch oven over medium-high heat. Add the mushrooms and the walnuts and cook until the all of the liquid has evaporated and the mushrooms have browned, about 8-10 minutes. Remove the mushroom/walnut mixture from the pot and set aside. (Don't clean out the pan; if there are areas of burned food, just scrape those out.)
Wipe out the food processor, and add the onion, carrots, celery and garlic. Process into a rough 'pulp,' about 30 seconds to 1 minute.
Heat 1 tablespoon of water in the pot or Dutch oven over medium-high heat. Add the vegetable pulp (onions, carrots, celery and garlic) with a pinch of salt to the pot. Saute until all of the liquid cooks off, the color turns from bright orange to a deeper orange-brown, and the volume is reduced by about half, about 10-12 minutes. Use the liquid released from the pulp to deglaze (loosen) any dark brown remnants of the mushroom/walnut mixture and blend it in. Stir and scrape loose any browned bits from the pan if they form. Add water a little at a time if things begin to stick or get too brown.
Move the browned pulp aside to the edges of the pot, leaving an empty spot in the center. Add the tomato paste to the center of the pot, and cook about 5 minutes until it begins to brown and get dark, but not burn. (Keep stirring and scraping, adding water 1 teaspoon at a time and reducing heat a bit only if things start to get too dark or burn.) When the tomato paste has browned, stir it into the vegetable pulp.
Add the red wine (or vinegar, if using instead) to the pot to deglaze (loosen) and scrape up all of the brown bits ("fond") that have formed in the pan--this adds flavor!
Add the mushroom/walnut mixture, and stir well to combine everything.
Add the smashed tomatoes and their liquid, water, and crushed red pepper flakes to the pot and stir well. Bring the sauce to a boil, lower the heat, and simmer, uncovered for 5 minutes so that the alcohol from the wine cooks off.
Add the thyme bundle and bay leaf, cover, and simmer for at least 30 minutes--or even better, one hour or more.
Before serving, remove the thyme bundle (and any loose stems) and the bay leaf, and season with sea salt, to taste.
Serve with polenta or pasta.
I see a lot of recipes for vegan chilis and sauces where mushrooms are sliced or chopped. While this is fine, grinding the mushrooms in the food processor truly transforms them into a hearty, 'meaty' texture and helps them brown thoroughly, which intensifies their flavor.
When grinding the mushrooms, some large pieces may remain, but don't keep pulsing. You want them finely ground but not mushy. Simply remove any large pieces, and add them back to the processor with the next batch. Repeat until all of the mushrooms are finely ground and transferred to the bowl.
I prefer to use whole tomatoes, as canned diced tomatoes contain a chemical (to keep them from dissolving), which alters their flavor. Also, I find there's no match for the flavor of San Marzanos, so I always use them. But chopping canned whole tomatoes can make a mess! To avoid this, I empty the whole can into a large bowl and break them up them with a potato masher.
I like to tie herbs like thyme into a bundle with kitchen string. It's a lot quicker than plucking the tiny leaves off their stems! However, if you don't tie the bundle tightly (and sometimes even if you do!) you can get loose stems in your sauce. To avoid a dinner-party faux pas, either add just the leaves or carefully sift through the sauce to find any stems.
If you prefer a thicker sauce, after 30 minutes to an hour, remove the lid and continue to simmer uncovered until the sauce is reduced to the desired consistency.