The Java Language Specification provides criteria for determining whether a (well-formed) execution satisfies "the causality requirement for the Java memory model". Let's assume that the execution is finite. I'm trying to understand if there's a polynomial-time algorithm for proving or disproving that this is the case.
Really, I'm not looking for a detailed complexity-theory type analysis, the question can be paraphrased more loosely as: Do these causality requirements actually provide a practical definition that can be applied to executions of programs in practice - and if so, how?
Indeed, the wording of the blue box seems to imply that the authors did have a practical way of sifting through the space of chains of subsets of actions called for in the formal definition - which I do not understand:
The memory model takes as input a given execution, and a program, and determines whether that execution is a legal execution of the program. It does this by gradually building a set of "committed" actions that reflect which actions were executed by the program. Usually, the next action to be committed will reflect the next action that can be performed by a sequentially consistent execution. However, to reflect reads that need to see later writes, we allow some actions to be committed earlier than other actions that happen-before them...
Informally, we allow an action to be committed early if we know that the action can occur without assuming some data race occurs."
If someone can apply this sketch to a simple example - that would be very helpful too.
EDIT: it was pointed out that perhaps the authors had in mind a recognizer, not a decider. I'm good with either - the whole complexity angle is just a way to ask if / how this definition can be applied in practice.
The closest thing I can find is an algorithm in Verification of the Java Causality Feature by S. Polyakov and A. Schuster.
The algorithm is used on java program execution traces (i.e. after the program finishes).
Its complexity is polynomial if the trace provides a commitment order of Reads for each thread (which requires some support computer architecture support).
The blue box contains a very condensed version of the JMM developers' reasoning behind the formal model of the JMM causality (which is located in the JLS right above the blue box).
If you want to see more detailed and easy-to-understand explanations, then I would recommend papers and articles by the creators of JMM: Jeremy Manson, William Pugh, Sarita Adve and Doug Lea.
For example these ones:
A nice short paper to start with.
This paper contains the most detailed explanations.
The paper includes chapter about simulator, which is what was used for JMM verification.
This is an overview paper: