Commit Graph

13 Commits

Author SHA1 Message Date
Zoltan Somogyi
aa2c89d12e Update expected outputs for --debug bootchecks. 2015-02-19 13:46:52 +11:00
Julien Fischer
b9027adee9 Fix a bunch of test cases that are failing in the debug or minimal model
Estimated hours taken: 0.5
Branches: main

Fix a bunch of test cases that are failing in the debug or minimal model
grades either because of my recent change to the standard library or Zoltan's
recent change to the code generator.

tests/debugger/breakpoints.exp2:
tests/debugger/loopcheck2.exp2:
tests/debugger/queens.exp2:
	Update the expected outputs for these test cases.  (These are the
	versions for the debug grades - the non-debug grade versions have
	already been updated.)

tests/general/string_format/string_format_lib.m:
tests/hard_coded/one_member.m:
tests/tabling/consumer_in_solutions.m:
tests/tabling/rotate2.m:
tests/tabling/sg.m:
	Conform to the recent break up of std_util.
2006-03-30 00:42:01 +00:00
Zoltan Somogyi
cdf0383b52 Fix a bunch of problems with tabling that I identified in Uppsala.
Estimated hours taken: 32
Branches: main

Fix a bunch of problems with tabling that I identified in Uppsala. These fall
into two categories.

First, the tabling transformations we were using were dividing work up
too finely. This had three bad effects. First, it caused too much time to be
spent on transmitting data to and from library predicates. Second, it made the
transformations hard to document and hard to explain in a paper. Third, it
caused us to misidentify just what the various forms of tabling have in common,
and what forms of tabling work for what determinisms. To fix this problem,
this diff reorients table_builtin.m and table_gen.m from being divided
primarily by determinism to being divided by evaluation method.

Second, we weren't being careful in separating out the parts of the tabling
data structures that are needed only for debugging the tabling system itself.
The fix for this is to introduce a new grade flag, MR_MINIMAL_MODEL_DEBUG,
intended for use by implementors only, to govern whether the tabling data
structures include debug-only components. (If this flag weren't a grade flag,
the sizes of data structures created in files with different values of this
flag could be inconsistent, which is something you don't want when debugging
the complex code of the tabling infrastructure.)

compiler/table_gen.m:
	Reorganize the simple (loopcheck and memo) tabling transformations
	completely. Instead of separate transformations for model_det and
	model_semi predicates, have separate transformations for loopcheck
	and memo predicates, since this makes it easier to see (and to ensure)
	that the transformation follows the required scheme. Instead of
	generating nested if-then-elses, generate switches when possible.

	For model_semi loopcheck and memo predicates, generate Mercury code
	that obeys our scope rules by not binding output variables in the
	condition of the one remaining if-then-else.

	Finetune the minimal model tabling transformation by combining some
	operations where this improves clarity and performance.

	Order the transformation predicates logically, and move the
	documentation of each form of tabling next to the code implementing
	that form of tabling.

	Attach call_table_gen markers to the setup goals that now all
	loopcheck, memo and minimal model tabled predicates have,
	to avoid having to special case the last lookup goal, and to avoid
	having to have separate code for lookups in call tables versus answer
	tables.

	Generate unique and more meaningful variable names. Change some
	predicate names to be more meaningful, both here and in the
	transformed code.

	Factor out some common code, e.g. for generating lookup goals,
	for generating instmap_deltas and for attaching hide_debug_event
	markers to goals.

	Report errors in cases where the arguments of a tabled predicate
	aren't completely input or output.

compiler/hlds_pred.m:
	Be more strict about the determinisms of tabled predicates; permit
	only the determinisms we really support in all cases, and do not
	permit the ones that may happen to work in some cases.

	Conform to the change of the name of a builtin.

compiler/det_report.m:
	Improve the error message for cases when the determinism is
	incompatible with the selected tabling mechanism.

compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/options.m:
	Handle the new grade component.

library/private_builtin.m:
	Provide a semipure analog of the imp predicate, a call to which makes
	predicates semipure rather than impure, for use in table_builtin.m.

library/table_builtin.m:
runtime/mercury_tabling_preds.h:
	Change the tabling primitives in the ways required by the changes to
	the tabling transformations.

	Group the primitives by the tabling methods they support, and change
	their names to reflect this.

	Change the implementation of each of the affected predicates to be
	nothing more than the invocation of a macro defined in the new header
	file runtime/mercury_tabling_preds.h. The objective of this change
	is to make it possible for table_gen.m to replace sequences of calls
	to predicates in table_builtin.m with a single extended foreign_proc
	goal whose body just invokes the corresponding macros in sequence.
	That change should improve performance by allowing the variables
	that flow from one tabling primitive to another to stay in x86
	registers, instead of being copied to and from Mercury abstract
	machines registers, which on the x86 aren't real machine registers.
	Benchmarking in Uppsala verified that this is a major cost.

	Mark the foreign types used for tabling as can_pass_as_mercury_type;
	this was the intended use of that assertion. Make them private to the
	module, since the rest of the compiler can now handle this.

	Delete the implementations of the predicates for duplicate checking
	and for returning answers for completed subgoals. Profiling with gprof
	has shown their performance to be critical to the performance of
	minimal model tabling overall, and even with our recent changes,
	the compiler still can't create optimal C code for them. They are
	now implemented with handwritten code in mercury_minimal_model.c.

library/term.m:
	Add two utility predicates for use by table_gen.m.

library/Mmakefile:
	Since much of the implementation of table_builtin.m is now in
	runtime/mercury_tabling_preds.h, make its object files depend
	on that header file.

runtime/mercury_conf_params.h:
runtime/mercury_grade.h:
	Include MR_MINIMAL_MODEL_DEBUG when computing the grade.

runtime/mercury_minimal_model.[ch]:
	Add handwritten code to implement the predicates declared as external
	in table_builtin.m.

	Conform to the new names of the suspension and completion predicates.

	Conform to the presence of debugging fields in tabling data structures
	only if MR_MINIMAL_MODEL_DEBUG is defined.

	Collect a lot more statistics than before.

	Reorder some functions.

	Instead of saving the whole generator stack each time, which the new
	statistics showed to have O(n^2) behavior on some benchmarks, save only
	the segment we need to save.

runtime/mercury_tabling.h:
	Conform to the fact that loopcheck and memo predicates now have
	separate sets of status values, and import mercury_tabling_preds.h.

runtime/mercury_tabling.c:
runtime/mercury_hash_lookup_or_add_body.h:
	Move a huge macro out of mercury_tabling.c to the new file
	mercury_hash_lookup_or_add_body.h for ease of editing, and modify it to
	gather more statistics.

	Make the statistics report easier to read.

runtime/Mmakefile:
	Mention mercury_tabling_preds.h and mercury_hash_lookup_or_add_body.h.

runtime/mercury_wrapper.h:
	Provide a mechanism (--tabling-statistics in MERCURY_OPTIONS)
	that causes the runtime to print tabling statistics at the ends of
	executions, for use in benchmarking.

doc/user_guide.texi:
	Document --tabling-statistics. (Minimal model tabling is not yet
	stable enough to be documented, which is why .dmm isn't documented
	either.)

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/mgnuc.in:
	Implement the new grade component.

trace/mercury_trace.c:
trace/mercury_trace_internal.c:
	Conform to changes in the runtime.

tests/debugger/*.m:
	Avoid now invalid combinations of determinism and evaluation method.

tests/debugger/*.exp:
	Conform to new goal paths in procedures transformed by tabling.

tests/tabling/*.m:
	For tests which had predicate whose determinisms isn't compatible
	with the evaluation method, change the determinism if possible,
	and the evaluation method otherwise, if either is possible.

	Bring these tests up to date with our coding guidelines, since they
	may now appear in papers.

tests/tabling/Mmakefile:
	Disable the tests whose combination of determinism and evaluation
	method is no longer supported, and in which neither one can be changed.

tests/tabling/loopcheck_no_loop.{m,exp}:
	Make this test case tougher.

tests/tabling/test_tabling:
	Make this script more robust in the face of different kinds of
	test case failures.

tests/invalid/loopcheck.{m,err_exp}:
tests/invalid/Mmakefile:
	Test that we get the expected error message for an invalid combination
	of determinism and evaluation method. The new test invalid/loopcheck.m
	is the old test tabling/loopcheck.m.

tests/valid/Mmakefile:
	Use a more general pattern to test for minimal model grades,
	now that we also use .dmm as a grade component.
2004-05-31 04:13:39 +00:00
Ralph Becket
a8ffd3680c Change the compiler and tools so that .' and not :' is now used as the
Estimated hours taken: 14
Branches: main

Change the compiler and tools so that `.' and not `:' is now used as the
module separator in all output.

Infix `.' now has associativity yfx and priority 10.

NEWS:
	Report the change.

configure.in:
	Amend the test for an up-to-date Mercury compiler to check whether
	it recognises `.' as a module qualifier.

compiler/code_gen.m:
compiler/error_util.m:
compiler/hlds_out.m:
compiler/prog_out.m:
compiler/prog_util.m:
compiler/rl_exprn.m:
compiler/rl_gen.m:
compiler/source_file_map.m:
compiler/unused_args.m:
library/io.m:
library/rtti_implementation.m:
library/type_desc.m:
runtime/mercury_debug.c:
runtime/mercury_deconstruct.c:
runtime/mercury_stack_trace.c:
	Change `:' to `.' as module separator for output.

compiler/mercury_to_mercury.m:
compiler/prog_io_typeclass.m:
	As above.
	Fixed a bug where `.' was not being recognised as a module separator.

doc/reference_manual.texi:
	Report the change.

library/term_io.m:
	Ensure that infix `.' is written without surrounding spaces.

tests/hard_coded/dot_separator.m:
tests/hard_coded/dot_separator.exp:
tests/hard_coded/Mmakefile:
	Test case added.
2003-01-17 05:57:20 +00:00
Zoltan Somogyi
5345fa4643 Fix (most of) the expected outputs of the debugger test cases after my recent
Estimated hours taken: 2
Branches: main

Fix (most of) the expected outputs of the debugger test cases after my recent
changes. In some cases, this involved modifying the input scripts to make tests
less dependent on event numbers.

tests/debugger/Mmakefile:
	Use MDB_STD instead of MDB for more test cases than before.

	Disable the output_term_dep test case, since it doesn't actually test
	anything that the other test cases don't test, and it prints so many
	events that its .exp files depend on event numbers far too much.

tests/debugger/*.exp*:
tests/debugger/*.inp:
	Update expected outputs, and in some cases, the inputs.
2002-09-13 03:37:45 +00:00
Peter Ross
1167698388 Changes now that we report that an Uncaught exception comes
Estimated hours taken: 3
Branches: main


debugger/exception_cmd.exp:
debugger/exception_cmd.exp2:
debugger/exception_vars.exp:
debugger/exception_vars.exp2:
debugger/loopcheck.exp:
debugger/loopcheck.exp2:
debugger/polymorphic_output.exp:
debugger/polymorphic_output.exp2:
debugger/polymorphic_output.exp3:
general/string_format_test_2.exp:
general/string_format_test_2.exp2:
general/string_format_test_2.exp3:
general/string_format_test_2.exp4:
general/string_format_test_3.exp:
general/string_format_test_3.exp2:
general/string_format_test_3.exp3:
general/string_format_test_3.exp4:
hard_coded/foreign_type.m:
hard_coded/no_fully_strict.exp:
hard_coded/no_fully_strict.exp2:
hard_coded/no_fully_strict.exp3:
hard_coded/no_fully_strict.exp4:
hard_coded/exceptions/test_uncaught_exception.exp:
hard_coded/exceptions/test_uncaught_exception.exp2:
hard_coded/exceptions/test_uncaught_exception.exp3:
hard_coded/exceptions/test_uncaught_exception.exp4:
tabling/loopcheck.exp:
tabling/loopcheck.exp2:
tabling/loopcheck.exp3:
tabling/loopcheck.exp4:
	Changes now that we report that an Uncaught exception comes
	from Mercury.
2002-07-25 16:20:56 +00:00
Simon Taylor
b29fd18b13 Avoid dependencies on the line number of `error/1'.
Estimated hours taken: 0.1
Branches: main

tests/debugger/Mmakefile:
tests/debugger/loopcheck.exp2:
	Avoid dependencies on the line number of `error/1'.
2001-12-16 04:46:04 +00:00
Simon Taylor
4401a8e53e I forgot to update the `.exp2' files in tests/debugger when I updated
Estimated hours taken: 0.1

I forgot to update the `.exp2' files in tests/debugger when I updated
the `.exp' files for my changes to tabling.

tests/debugger/loopcheck.exp2:
tests/debugger/retry.exp2:
	Adjust the expected output. The change to ensure that
	`call_table_gen' goal features can't be removed alters
	the goal paths slightly.
2001-03-30 03:59:18 +00:00
Zoltan Somogyi
518e6e46db Strip away goal paths from exception events in the test cases that
Estimated hours taken: 0.5

tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
	Strip away goal paths from exception events in the test cases that
	generate them, because different optimization levels cause different
	goals paths to be associated with exceptions.

tests/debugger/*.exp{,2}:
tests/debugger/declarative/*.exp{,2}:
	Strip away goal paths from exception events in the expected outputs
	of those test cases.
2000-11-01 04:26:32 +00:00
Mark Brown
250a3026da Update the expected output for these test cases in debug grades,
Estimated hours taken: 0.2

tests/debugger/*.exp2:
tests/debugger/declarative/*.exp2:
	Update the expected output for these test cases in debug grades,
	after Zoltan's recent change to `retry'.
2000-10-18 14:38:04 +00:00
Fergus Henderson
0634f6b8b7 Update the expected output to reflect Zoltan's recent
Estimated hours taken: 0.1

tests/debugger/loopcheck.exp2:
	Update the expected output to reflect Zoltan's recent
	addition of an "echo on" command to loopcheck.inp.
2000-03-27 11:50:26 +00:00
Fergus Henderson
a6e602a7f8 Update to match the actual output for this test case
Estimated hours taken: 0.25

tests/debugger/loopcheck.exp2:
	Update to match the actual output for this test case
	on quicksilver.
2000-01-23 00:57:11 +00:00
Zoltan Somogyi
a822f78b3c Add meaningful contexts to the goals inserted into predicates by tabling,
Estimated hours taken: 4

Add meaningful contexts to the goals inserted into predicates by tabling,
for use by the debugger.

compiler/table_gen.m:
	Pass the context of the procedure body through the code, and create
	new goals with this context.

	To make this simpler, switch to consistently using combined predmode
	definitions. In a couple of places, switch to a more reasonable
	argument ordering.

tests/debugger/loopcheck.*
	Copy this test case here from the tabling directory, and execute it
	under mdb, as a regression test.

	The exp2 test case is not final yet.

tests/debugger/Mmakefile:
	Enable the regression test.
1999-12-21 01:23:44 +00:00